Skip to content

Commit

Permalink
Merge pull request #1274 from overte-org/feature/graphics_icon
Browse files Browse the repository at this point in the history
Add a setting to hide the Graphics icon
  • Loading branch information
ksuprynowicz authored Dec 20, 2024
2 parents c633ac9 + d06f8bc commit 06ebb0c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions interface/src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
const bool DEFAULT_PREFER_STYLUS_OVER_LASER = false;
const bool DEFAULT_PREFER_AVATAR_FINGER_OVER_STYLUS = false;
const bool DEFAULT_SHOW_GRAPHICS_ICON = true;
const QString DEFAULT_CURSOR_NAME = "SYSTEM";
const bool DEFAULT_MINI_TABLET_ENABLED = false;
const bool DEFAULT_AWAY_STATE_WHEN_FOCUS_LOST_IN_VR_ENABLED = true;
Expand Down Expand Up @@ -1010,6 +1011,7 @@ Application::Application(
_hmdTabletBecomesToolbarSetting("hmdTabletBecomesToolbar", DEFAULT_HMD_TABLET_BECOMES_TOOLBAR),
_preferStylusOverLaserSetting("preferStylusOverLaser", DEFAULT_PREFER_STYLUS_OVER_LASER),
_preferAvatarFingerOverStylusSetting("preferAvatarFingerOverStylus", DEFAULT_PREFER_AVATAR_FINGER_OVER_STYLUS),
_showGraphicsIconSetting("showGraphicsIcon", DEFAULT_SHOW_GRAPHICS_ICON),
_constrainToolbarPosition("toolbar/constrainToolbarToCenterX", true),
_awayStateWhenFocusLostInVREnabled("awayStateWhenFocusLostInVREnabled", DEFAULT_AWAY_STATE_WHEN_FOCUS_LOST_IN_VR_ENABLED),
_preferredCursor("preferredCursor", DEFAULT_CURSOR_NAME),
Expand Down Expand Up @@ -3841,6 +3843,11 @@ void Application::setPreferAvatarFingerOverStylus(bool value) {
_preferAvatarFingerOverStylusSetting.set(value);
}

void Application::setShowGraphicsIcon(bool value) {
_showGraphicsIconSetting.set(value);
DependencyManager::get< MessagesClient >()->sendLocalMessage("Overte-ShowGraphicsIconChanged", "");
}

void Application::setPreferredCursor(const QString& cursorName) {
qCDebug(interfaceapp) << "setPreferredCursor" << cursorName;

Expand Down
4 changes: 4 additions & 0 deletions interface/src/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ class Application : public QApplication,
bool getPreferAvatarFingerOverStylus() { return _preferAvatarFingerOverStylusSetting.get(); }
void setPreferAvatarFingerOverStylus(bool value);

bool getShowGraphicsIcon() { return _showGraphicsIconSetting.get(); }
void setShowGraphicsIcon(bool value);

bool getMiniTabletEnabled() { return _miniTabletEnabledSetting.get(); }
void setMiniTabletEnabled(bool enabled);

Expand Down Expand Up @@ -723,6 +726,7 @@ private slots:
Setting::Handle<bool> _hmdTabletBecomesToolbarSetting;
Setting::Handle<bool> _preferStylusOverLaserSetting;
Setting::Handle<bool> _preferAvatarFingerOverStylusSetting;
Setting::Handle<bool> _showGraphicsIconSetting;
Setting::Handle<bool> _constrainToolbarPosition;
Setting::Handle<bool> _awayStateWhenFocusLostInVREnabled;
Setting::Handle<QString> _preferredCursor;
Expand Down
6 changes: 6 additions & 0 deletions interface/src/ui/PreferencesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ void setupPreferences() {
preferences->addPreference(delaySlider);
}

{
auto getter = []() -> bool { return qApp->getShowGraphicsIcon(); };
auto setter = [](bool value) { qApp->setShowGraphicsIcon(value); };
preferences->addPreference(new CheckPreference(UI_CATEGORY, "Show Graphics icon on tablet and toolbar", getter, setter));
}

static const QString VIEW_CATEGORY{ "View" };
{
auto getter = [myAvatar]()->float { return myAvatar->getRealWorldFieldOfView(); };
Expand Down

0 comments on commit 06ebb0c

Please sign in to comment.