From abdee1e77e2790e0f47c19968913a6eebb647483 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:15:26 -0700 Subject: [PATCH] Organize UI into pages, adjust license view --- gnome/src/extension.js | 2 +- gnome/src/xrEffect.js | 20 +- .../com.xronlinux.BreezyDesktop.gschema.xml | 6 +- ui/src/connecteddevice.py | 28 +- ui/src/gtk/connected-device.ui | 546 +++++++++--------- ui/src/gtk/license-dialog.ui | 4 +- ui/src/licensefeaturerow.py | 8 +- ui/src/licensetierrow.py | 2 +- 8 files changed, 305 insertions(+), 311 deletions(-) diff --git a/gnome/src/extension.js b/gnome/src/extension.js index 0d90c52..4c27e39 100644 --- a/gnome/src/extension.js +++ b/gnome/src/extension.js @@ -222,7 +222,7 @@ export default class BreezyDesktopExtension extends Extension { this._start_binding = this.settings.bind('toggle-display-distance-start', this._xr_effect, 'toggle-display-distance-start', Gio.SettingsBindFlags.DEFAULT) this._end_binding = this.settings.bind('toggle-display-distance-end', this._xr_effect, 'toggle-display-distance-end', Gio.SettingsBindFlags.DEFAULT) this._curved_display_binding = this.settings.bind('curved-display', this._xr_effect, 'curved-display', Gio.SettingsBindFlags.DEFAULT) - this._display_size_binding = this.settings.bind('widescreen-display-size', this._xr_effect, 'widescreen-display-size', Gio.SettingsBindFlags.DEFAULT); + this._display_size_binding = this.settings.bind('display-size', this._xr_effect, 'display-size', Gio.SettingsBindFlags.DEFAULT); this._overlay.add_effect_with_name('xr-desktop', this._xr_effect); Meta.disable_unredirect_for_display(global.display); diff --git a/gnome/src/xrEffect.js b/gnome/src/xrEffect.js index 3471aad..e3764a4 100644 --- a/gnome/src/xrEffect.js +++ b/gnome/src/xrEffect.js @@ -218,6 +218,15 @@ export const XREffect = GObject.registerClass({ 2.5, 1.05 ), + 'display-size': GObject.ParamSpec.double( + 'display-size', + 'Display size', + 'Size of the display', + GObject.ParamFlags.READWRITE, + 0.2, + 2.5, + 1.0 + ), 'toggle-display-distance-start': GObject.ParamSpec.double( 'toggle-display-distance-start', 'Display distance start', @@ -249,15 +258,6 @@ export const XREffect = GObject.registerClass({ 'The state of widescreen mode from the perspective of the driver', GObject.ParamFlags.READWRITE, false - ), - 'widescreen-display-size': GObject.ParamSpec.double( - 'widescreen-display-size', - 'Widescreen display size', - 'Size of the display when in widescreen/SBS mode', - GObject.ParamFlags.READWRITE, - 0.2, - 2.5, - 1.0 ) } }, class XREffect extends Shell.GLSLEffect { @@ -344,7 +344,7 @@ export const XREffect = GObject.registerClass({ setSingleFloat(this, 'display_north_offset', this.display_distance); setSingleFloat(this, 'look_ahead_ms', lookAheadMS(this._dataView)); setUniformMatrix(this, 'imu_quat_data', 4, this._dataView, IMU_QUAT_DATA); - setSingleFloat(this, 'display_size', this.widescreen_mode_state ? this.widescreen_display_size : 1.0); + setSingleFloat(this, 'display_size', this.display_size); success = true; } } else if (this._dataView.byteLength !== 0) { diff --git a/ui/data/com.xronlinux.BreezyDesktop.gschema.xml b/ui/data/com.xronlinux.BreezyDesktop.gschema.xml index ae031f1..738ca6f 100644 --- a/ui/data/com.xronlinux.BreezyDesktop.gschema.xml +++ b/ui/data/com.xronlinux.BreezyDesktop.gschema.xml @@ -73,13 +73,13 @@ Enable widescreen/SBS mode - + 1.0 - Widescreen display size + Display size - The size of the display when in widescreen/SBS mode + The size of the display diff --git a/ui/src/connecteddevice.py b/ui/src/connecteddevice.py index ac5ddfc..a47b160 100644 --- a/ui/src/connecteddevice.py +++ b/ui/src/connecteddevice.py @@ -12,18 +12,14 @@ class ConnectedDevice(Gtk.Box): device_label = Gtk.Template.Child() effect_enable_switch = Gtk.Template.Child() - display_distance_row = Gtk.Template.Child() display_distance_scale = Gtk.Template.Child() display_distance_adjustment = Gtk.Template.Child() + display_size_scale = Gtk.Template.Child() + display_size_adjustment = Gtk.Template.Child() follow_threshold_scale = Gtk.Template.Child() follow_threshold_adjustment = Gtk.Template.Child() follow_mode_switch = Gtk.Template.Child() widescreen_mode_switch = Gtk.Template.Child() - widescreen_display_distance_row = Gtk.Template.Child() - widescreen_display_distance_scale = Gtk.Template.Child() - widescreen_display_distance_adjustment = Gtk.Template.Child() - widescreen_display_size_scale = Gtk.Template.Child() - widescreen_display_size_adjustment = Gtk.Template.Child() curved_display_switch = Gtk.Template.Child() set_toggle_display_distance_start_button = Gtk.Template.Child() set_toggle_display_distance_end_button = Gtk.Template.Child() @@ -39,11 +35,10 @@ class ConnectedDevice(Gtk.Box): self.init_template() self.all_enabled_state_inputs = [ self.display_distance_scale, + self.display_size_scale, self.follow_mode_switch, self.follow_threshold_scale, self.widescreen_mode_switch, - self.widescreen_display_distance_scale, - self.widescreen_display_size_scale, self.curved_display_switch, self.set_toggle_display_distance_start_button, self.set_toggle_display_distance_end_button, @@ -57,10 +52,9 @@ class ConnectedDevice(Gtk.Box): self.extensions_manager = ExtensionsManager.get_instance() self.settings.bind('display-distance', self.display_distance_adjustment, 'value', Gio.SettingsBindFlags.DEFAULT) - self.settings.bind('display-distance', self.widescreen_display_distance_adjustment, 'value', Gio.SettingsBindFlags.DEFAULT) + self.settings.bind('display-size', self.display_size_adjustment, 'value', Gio.SettingsBindFlags.DEFAULT) self.settings.bind('follow-threshold', self.follow_threshold_adjustment, 'value', Gio.SettingsBindFlags.DEFAULT) self.settings.bind('widescreen-mode', self.widescreen_mode_switch, 'active', Gio.SettingsBindFlags.DEFAULT) - self.settings.bind('widescreen-display-size', self.widescreen_display_size_adjustment, 'value', Gio.SettingsBindFlags.DEFAULT) self.settings.bind('curved-display', self.curved_display_switch, 'active', Gio.SettingsBindFlags.DEFAULT) bind_shortcut_settings(self.get_parent(), [ @@ -81,8 +75,6 @@ class ConnectedDevice(Gtk.Box): self.follow_mode_switch.set_active(self.state_manager.follow_mode) self.follow_mode_switch.connect('notify::active', self._refresh_follow_mode) - self.widescreen_mode_switch.connect('notify::active', self._refresh_widescreen_mode) - self.effect_enable_switch.set_active(self._is_config_enabled(self.ipc.retrieve_config()) and self.extensions_manager.is_enabled()) self.effect_enable_switch.connect('notify::active', self._refresh_inputs_for_enabled_state) @@ -101,14 +93,6 @@ class ConnectedDevice(Gtk.Box): def _is_config_enabled(self, config): return config.get('disabled') == False and 'breezy_desktop' in config.get('external_mode', []) - - def _refresh_widescreen_mode(self, switch, param): - widescreen_mode_enabled = switch.get_active() - self.widescreen_display_distance_row.set_visible(widescreen_mode_enabled) - self.display_distance_row.set_visible(not widescreen_mode_enabled) - for widget in [self.widescreen_display_distance_scale, self.widescreen_display_size_scale]: - widget.set_sensitive(widescreen_mode_enabled) - def _refresh_inputs_for_enabled_state(self, switch, param): requesting_enabled = switch.get_active() @@ -126,7 +110,6 @@ class ConnectedDevice(Gtk.Box): if requesting_enabled: self._refresh_follow_mode(self.follow_mode_switch, None) - self._refresh_widescreen_mode(self.widescreen_mode_switch, None) def _refresh_follow_mode(self, switch, param): self.follow_threshold_scale.set_sensitive(switch.get_active()) @@ -148,6 +131,7 @@ class ConnectedDevice(Gtk.Box): def _on_widget_destroy(self, widget): self.state_manager.unbind_property('follow-mode', self.follow_mode_switch, 'active') self.settings.unbind('display-distance', self.display_distance_adjustment, 'value') + self.settings.unbind('display-size', self.display_size_adjustment, 'value') self.settings.unbind('follow-threshold', self.follow_threshold_adjustment, 'value') self.settings.unbind('widescreen-mode', self.widescreen_mode_switch, 'active') self.extensions_manager.unbind_property('breezy-enabled', self.effect_enable_switch, 'active') @@ -160,4 +144,4 @@ def on_set_display_distance_toggle(widget): settings = SettingsManager.get_instance().settings distance = settings.get_double('display-distance') settings.set_double(widget.get_name(), distance) - reload_display_distance_toggle_button(widget) \ No newline at end of file + reload_display_distance_toggle_button(widget) diff --git a/ui/src/gtk/connected-device.ui b/ui/src/gtk/connected-device.ui index 29ab274..c06ffb2 100644 --- a/ui/src/gtk/connected-device.ui +++ b/ui/src/gtk/connected-device.ui @@ -24,288 +24,298 @@ - - Settings + - - Effect enabled - Turn on or off the XR desktop effect - - - 3 - - - - - - - Display distance - - - 3 - true - 0 - 2 - 350 - false - - - 0.2 - 2.5 - 0.01 - 1.05 + + general + General Settings + applications-system-symbolic + + + 1 + 20 + 20 + 20 + 20 + 20 + + + Features + + + XR effect + Enables the Breezy Desktop XR effect. + + + 3 + + + + + + + Widescreen mode + Switches your glasses into side-by-side mode and doubles the width of the display. + 2 + + + 3 + + + + + + + Follow mode + Keep the virtual display near the center of your view. + + + 3 + + + + + + + Curved display + Switch between flat and curved displays. + 2 + + + 3 + + + + - - - - - - - - - - - - - Follow enabled - Keep the virtual display near the center of your view - - - 3 - - - - - - - Follow threshold - How far away you can look before the display follows - - - 3 - true - 0 - 0 - 350 - false - - - 1 - 45 - 1 - 15 + + + + Adjustments + + + Display distance + Closer appears larger, further appears smaller. Controls depth when in widescreen mode. + + + 3 + true + 0 + 2 + 350 + false + + + 0.2 + 2.5 + 0.01 + 1.05 + + + + + + + + + + + + + + Display size + Combine with display distance to achieve a comfortable level of depth and size. + + + 3 + true + 0 + 2 + 350 + false + + + 0.2 + 2.5 + 0.01 + 1.0 + + + + + + + + + + + + + + Display toggle distances + Use the buttons to capture the current display distance for use with the keyboard shortcut. + 2 + + + 30 + 150 + 30 + + + toggle-display-distance-start + 3 + + + + + toggle-display-distance-end + 3 + + + + + + + + + Follow threshold + How far away you can look before the display follows. + + + 3 + true + 0 + 0 + 350 + false + + + 1 + 45 + 1 + 15 + + + + + + - + - + - - Curved display - Switch between flat and curved displays - 2 - - - 3 - - - - - - - - Widescreen - Widescreen mode switches your glasses into side-by-side mode and doubles the width of the display - - - Enable widescreen - Switches your glasses into side-by-side mode - 2 - - - 3 - - - - - - - Display distance - Move the screen closer or further using SBS depth - - - 3 - true - 0 - 2 - 350 - false - - - 0.2 - 2.5 - 0.01 - 1.05 + + shortcuts + Shortcuts + preferences-desktop-keyboard-shortcuts-symbolic + + + + + Shortcuts + Modify keyboard shortcuts and how they work. + + + Re-center display shortcut + Pin the virtual display to the current position. + 2 + + + 30 + 30 + + + 3 + + + + + + + recenter-display-shortcut + 3 + Change + + + + + + + + + Display distance shortcut + Quickly toggle between two predefined distances. + 2 + + + 30 + 30 + + + 3 + + + + + + + toggle-display-distance-shortcut + 3 + Change + + + + + + + + + Toggle follow mode shortcut + Quickly toggle follow mode. + 2 + + + 30 + 30 + + + 3 + + + + + + + toggle-follow-shortcut + 3 + Change + + + + + + - - - - - - + - - - - - - Display size - Combine with display distance to achieve a comfortable level of depth and size - - - 3 - true - 0 - 2 - 350 - false - - - 0.2 - 2.5 - 0.01 - 1.0 - - - - - - - - - + - - Shortcuts - Modify keyboard shortcuts and how they work - - - Re-center display shortcut - Pin the virtual display to the current position - 2 - - - 30 - 30 - - - 3 - - - - - - - recenter-display-shortcut - 3 - Change - - - - - - - - - Display distance shortcut - Quickly toggle between two predefined distances - 2 - - - 30 - 30 - - - 3 - - - - - - - toggle-display-distance-shortcut - 3 - Change - - - - - - - - - Display distance start and end - Use the buttons to capture the current display distance as start and end points. - 2 - - - 30 - 150 - 30 - - - toggle-display-distance-start - 3 - - - - - toggle-display-distance-end - 3 - - - - - - - - - Toggle follow mode shortcut - Quickly toggle follow mode - 2 - - - 30 - 30 - - - 3 - - - - - - - toggle-follow-shortcut - 3 - Change - - - - - - + + stack + wide diff --git a/ui/src/gtk/license-dialog.ui b/ui/src/gtk/license-dialog.ui index 896b618..2954559 100644 --- a/ui/src/gtk/license-dialog.ui +++ b/ui/src/gtk/license-dialog.ui @@ -57,11 +57,11 @@ - + - + diff --git a/ui/src/licensefeaturerow.py b/ui/src/licensefeaturerow.py index 5f4904a..7d55ed8 100644 --- a/ui/src/licensefeaturerow.py +++ b/ui/src/licensefeaturerow.py @@ -3,10 +3,10 @@ from gi.repository import Adw from .time import time_remaining_text FEATURE_NAMES = { - 'sbs': 'Side-by-side mode (for gaming)', - 'smooth_follow': 'Smooth Follow', - 'productivity_basic': 'Breezy Desktop', - 'productivity_pro': 'Breezy Desktop w/ multiple monitors', + 'sbs': 'Side-by-side mode (gaming)', + 'smooth_follow': 'Smooth Follow (gaming)', + 'productivity_basic': 'Breezy Desktop (productivity)', + 'productivity_pro': 'Breezy Desktop Pro (productivity)', } class LicenseFeatureRow(Adw.ActionRow): diff --git a/ui/src/licensetierrow.py b/ui/src/licensetierrow.py index 9ee6cc7..9f5917c 100644 --- a/ui/src/licensetierrow.py +++ b/ui/src/licensetierrow.py @@ -53,7 +53,7 @@ class LicenseTierRow(Adw.ExpanderRow): elif active_period is not None: amount_text += " to upgrade" elif active_period is not None and PERIOD_RANKS[period] >= PERIOD_RANKS[active_period]: - amount_text = "Ready to auto-renew" + amount_text = "Paid through next renewal period" if amount_text is not None: row_widget = Adw.ActionRow(title=period.capitalize())