diff --git a/discover_overlay/glade/settings.glade b/discover_overlay/glade/settings.glade index 558056e..39579bd 100644 --- a/discover_overlay/glade/settings.glade +++ b/discover_overlay/glade/settings.glade @@ -289,7 +289,7 @@ - + voice_grid True @@ -300,1396 +300,489 @@ 5 5 5 - 1 - 1 - True + 3 + 3 - - - voice_location_grid + + voice_display_horizontally_label True False - center - 40 - 1 - 1 - True - - - voice_overlay_location_label - True - False - Overlay Location - - - 0 - 0 - - - - - voice_align_2 - True - False - 0 - - Top - Middle - Bottom - - - - - 0 - 4 - - - - - voice_align_1 - True - False - 0 - - Left - Right - - - - - 0 - 3 - - - - - voice_monitor - True - False - - - - 0 - 2 - - - - - - voice_location_grid_anchor - True - False - - - Anchor To Edge - voice_anchor_to_edge_button - True - True - False - True - True - - - - 0 - 0 - - - - - Floating - voice_floating_button - True - True - False - True - True - anchortoedge - - - - 1 - 0 - - - - - 0 - 1 - - - - - Show Advanced Options - voice_show_advanced_options_button - True - True - True - - - - 0 - 7 - - - - - Place Window - voice_place_window_button - True - True - True - - - - 0 - 6 - - - - - - voice_location_grid_horizontal - True - False - - - voice_display_horizontally - True - True - False - True - - - - 1 - 0 - - - - - voice_display_horizontally_label - True - False - 28 - Display Horizontally - 0 - - - 0 - 0 - - - - - 0 - 5 - - + 28 + 28 + Display Horizontally + 0 + + + 0 + 5 + + + + + voice_display_horizontally + True + True + False + True + + + + 1 + 5 + + + + + voice_talking_label + True + False + Talking + + + 2 + 1 + + + + + voice_idle_label + True + False + Idle + + + 2 + 2 + + + + + voice_mute_label + True + False + Mute + + + 2 + 3 + + + + + voice_avatar_label + True + False + Avatar + + + 2 + 4 + + + + + voice_foreground_label + 100 + True + False + 4 + 4 + 4 + 4 + Foreground + + + 3 + 0 + + + + + voice_background_label + 100 + True + False + 4 + 4 + 4 + 4 + Background + + + 4 + 0 + + + + + voice_border_label + 100 + True + False + 4 + 4 + 4 + 4 + Border + + + 5 + 0 + + + + + voice_talking_foreground + True + True + True + True + + + + 3 + 1 + + + + + voice_talking_background + True + True + True + True + + + + 4 + 1 + + + + + voice_talking_border + True + True + True + True + + + + 5 + 1 + + + + + voice_idle_foreground + True + True + True + True + + + + 3 + 2 + + + + + voice_idle_background + True + True + True + True + + + + 4 + 2 + + + + + voice_idle_border + True + True + True + True + + + + 5 + 2 + + + + + voice_mute_foreground + True + True + True + True + + + + 3 + 3 + + + + + voice_mute_background + True + True + True + True + + + + 4 + 3 + + + + + voice_avatar_background + True + True + True + True + + + + 4 + 4 + + + + + voice_hide_mouseover_label + True + False + Hide Overlay on Mouseover + 0 + + + 6 + 1 + + + + + voice_hide_mouseover + True + True + False + True + + + + 7 + 1 + + + + + voice_show_mouseover_label + True + False + Show again after (seconds) + 0 + + + 6 + 2 + + + + + voice_show_mouseover + True + True + 1 + voice_show_mouseover_adj + 1 + + + + 7 + 2 + + + + + voice_overlay_location_label + True + False + Overlay Location 0 0 + 2 - - - voice_colour_grid + + voice_anchor_float True False - center - 40 - 1 - 1 - True - True - - - voice_foreground_label - True - False - 4 - 4 - Foreground - - - 1 - 0 - - - - - voice_background_label - True - False - 4 - 4 - Background - - - 2 - 0 - - - - - voice_border_label - True - False - 4 - 4 - Border - - - 3 - 0 - - - - - voice_talking_label - True - False - Talking - - - 0 - 1 - - - - - voice_idle_label - True - False - Idle - - - 0 - 2 - - - - - voice_mute_label - True - False - Mute - - - 0 - 3 - - - - - voice_avatar_label - True - False - Avatar - - - 0 - 4 - - - - - voice_talking_foreground - True - True - True - True - - - - 1 - 1 - - - - - voice_talking_background - True - True - True - True - - - - 2 - 1 - - - - - voice_talking_border - True - True - True - True - - - - 3 - 1 - - - - - voice_idle_foreground - True - True - True - True - - - - 1 - 2 - - - - - voice_idle_background - True - True - True - True - - - - 2 - 2 - - - - - voice_idle_border - True - True - True - True - - - - 3 - 2 - - - - - voice_mute_foreground - True - True - True - True - - - - 1 - 3 - - - - - voice_mute_background - True - True - True - True - - - - 2 - 3 - - - - - voice_avatar_background - True - True - True - True - - - - 2 - 4 - - - - - - - - - - - - - - - - - 1 - 0 - - - - - - voice_advanced_grid - True - False - 1 - 5 - True - - - voice_display_icon_only_label - True - False - Show Names - 0 - - - 2 - 0 - - - - - voice_display_icon_only - True - True - False - True - - - - 3 - 0 - - - - - voice_font_label - True - False - Font - 0 - - - 2 - 1 - - - - - voice_font - True - True - True - Sans 12 - en-us - - - - - 3 - 1 - - - - - voice_text_padding_label - True - False - Text Padding - 0 - - - 2 - 2 - - - - - voice_text_padding - True - True - 0 - text_padding_adj - - - - 3 - 2 - - - - - voice_text_vertical_offset_label - True - False - Text Vertical Offset - 0 - - - 2 - 3 - - - - - voice_text_vertical_offset - True - True - 0 - voice_text_offset - - - - 3 - 3 - - - - - voice_show_title_label - True - False - Show Title - 0 - - - 0 - 0 - - - - - voice_show_title - True - True - False - True - - - - 1 - 0 - - - - - voice_show_connection_status_label - True - False - Show Connection Status - 0 - - - 0 - 2 - - - - - voice_show_connection_status - True - True - False - True - - - - 1 - 2 - - - - - voice_title_font - True - True - True - Sans 12 - en-us - - - - - 1 - 1 - - - - - voice_title_font_label - True - False - Title Font - 0 - - - 0 - 1 - - - - - voice_vertical_padding - True - True - 0 - voice_vertical_padding_adj - - - - 1 - 4 - - - - - voice_horizontal_padding_label - True - False - Horizontal Edge Padding - 0 - - - 0 - 5 - - - - - voice_horizontal_padding - True - True - 0 - voice_horizontal_padding_adj - - - - 1 - 5 - - - - - voice_show_test_content_label - True - False - Show Test Content - 0 - - - 0 - 7 - - - - - voice_show_test_content - True - True - False - True - - - - 1 - 7 - - - - - voice_dummy_count_label - True - False - Test Data Count - 0 - - - 0 - 8 - - - - - voice_dummy_count - True - True - 50 - voice_dummy_count_adj - 50 - - - - 1 - 8 - - - - - voice_show_disconnected_label - True - False - Show While Disconnected - 0 - - - 0 - 9 - - - - - voice_show_disconnected - True - True - False - True - - - - 1 - 9 - - - - - voce_vertical_padding_label - True - False - Verticle Edge Padding - 0 - - - 0 - 4 - - - - - voice_nick_length_label - True - False - Limit text length - 0 - - - 2 - 4 - - - - - voice_nick_length - True - True - 32 - voice_nick_lenght_adj - 32 - - - - 3 - 4 - - - - - voice_avatar_label - True - False - Show Avatar - 0 - - - 2 - 5 - - - - - voice_show_avatar - True - True - False - True - - - - 3 - 5 - - - - - voice_square_avatar_label - True - False - Square Avatar - 0 - - - 2 - 6 - - - - - voice_square_avatar - True - True - False - True - - - - 3 - 6 - - - - - voice_fancy_avatar_shapes_label - True - False - Fancy Avatar Shapes - 0 - - - 2 - 7 - - - - - voice_fancy_avatar_shapes - True - True - False - True - - - - 3 - 7 - - - - - voice_avatar_size_label - True - False - Avatar Size - 0 - - - 2 - 8 - - - - - voice_avatar_size - True - True - 48 - avatar_size_adj - 48 - - - - 3 - 8 - - - - - voice_avatar_opacity_label - True - False - Avatar Opacity - 0 - - - 2 - 9 - - - - - voice_avatar_opacity - True - True - ava_opacity_adj - 1 - - - - 3 - 9 - - - - - voice_display_speakers_only_label - True - False - Display Speakers Only - 0 - - - 4 - 0 - - - - - voice_display_speakers_only - True - True - False - True - - - - 5 - 0 - - - - - voice_display_speakers_grace_period_label - True - False - Speakers Grace Period - 0 - - - 4 - 1 - - - - - voice_display_speakers_grace_period - True - True - 0 - voice_display_speakers_grace_period_adj - - - - 5 - 1 - - - - - voice_overflow_style_label - True - False - Overflow Style - 0 - - - 4 - 2 - - - - - voice_overflow_style - True - False - - None - Wrap - Shrink - - - - - 5 - 2 - - - - - voice_order_avatars_by_label - True - False - Order Users By - 0 - - - 4 - 3 - - - - - voice_order_avatars_by - True - False - - Alphabetically - ID - Last Spoken - - - - - 5 - 3 - - - - - voice_highlight_self_label - True - False - Highlight Self - 0 - - - 4 - 4 - - - - - voice_highlight_self - True - True - False - True - - - - 5 - 4 - - - - - voice_border_width_label - True - False - Border width - 0 - - - 4 - 5 - - - - - voice_border_width - True - True - 1 - border_width_adj - 1 - - - - 5 - 5 - - - - - voice_icon_spacing_label - True - False - Padding between users - 0 - - - 4 - 6 - - - - - voice_icon_spacing - True - True - 0 - icon_spacing_adj - - - - 5 - 6 - - - - - Reset Voice Settings - voice_reset_all - True - True - True - - - - 5 - 12 - - - - - voice_inactive_fade_label - True - False - Fade out when Inactive - 0 - - - 4 - 7 - - - - - voice_inactive_opacity_label - True - False - Inactive Opacity - 0 - - - 4 - 8 - - - - - voice_inactive_time_label - True - False - Time before Inactive - 0 - - - 4 - 9 - - - - - voice_inactive_fade_time_label - True - False - Time Fading out - 0 - - - 4 - 10 - - - - - voice_inactive_fade - True - True - False - True - - - - 5 - 7 - - - - - voice_inactive_opacity - True - True - voice_inactive_fade_opacity - 1 - - - - 5 - 8 - - - - - voice_inactive_time - True - True - 0 - voice_inactive_time_range - - - - 5 - 9 - - - - - voice_inactive_fade_time - True - True - 0 - voice_inactive_fade_time_range - - - - 5 - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 0 + + Floating + Anchor to Edge + + 0 1 - 3 + 2 - - - voice_mouseover_grid + + voice_monitor True False - - - voice_hide_mouseover_label - True - False - Hide Overlay on Mouseover - 0 - - - 0 - 0 - - - - - voice_show_mouseover_label - True - False - Show again after (seconds) - 0 - - - 0 - 1 - - - - - voice_hide_mouseover - True - True - False - True - - - - 1 - 0 - - - - - voice_show_mouseover - True - True - voice_show_mouseover_adj - - - - 1 - 1 - - + - 2 - 0 + 0 + 2 + 2 + + + voice_align_1 + True + False + 0 + + Left + Right + + + + + 0 + 3 + 2 + + + + + voice_align_2 + True + False + 0 + + Top + Middle + Bottom + + + + + 0 + 4 + 2 + + + + + Place Window + voice_place_window_button + True + True + True + + + + 0 + 3 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + False @@ -1704,6 +797,900 @@ False + + + + voice_advanced_grid + True + False + 1 + 5 + + + voice_display_icon_only_label + True + False + Show Names + 0 + + + 2 + 0 + + + + + voice_display_icon_only + True + True + False + True + + + + 3 + 0 + + + + + voice_font_label + True + False + Font + 0 + + + 2 + 1 + + + + + voice_font + True + True + True + Sans 12 + en-us + + + + + 3 + 1 + + + + + voice_text_padding_label + True + False + Text Padding + 0 + + + 2 + 2 + + + + + voice_text_padding + True + True + 0 + text_padding_adj + + + + 3 + 2 + + + + + voice_text_vertical_offset_label + True + False + Text Vertical Offset + 0 + + + 2 + 3 + + + + + voice_text_vertical_offset + True + True + 0 + voice_text_offset + + + + 3 + 3 + + + + + voice_show_title_label + True + False + Show Title + 0 + + + 0 + 0 + + + + + voice_show_title + True + True + False + True + + + + 1 + 0 + + + + + voice_show_connection_status_label + True + False + Show Connection Status + 0 + + + 0 + 2 + + + + + voice_show_connection_status + True + True + False + True + + + + 1 + 2 + + + + + voice_title_font + True + True + True + Sans 12 + en-us + + + + + 1 + 1 + + + + + voice_title_font_label + True + False + Title Font + 0 + + + 0 + 1 + + + + + voice_vertical_padding + True + True + 0 + voice_vertical_padding_adj + + + + 1 + 4 + + + + + voice_horizontal_padding_label + True + False + Horizontal Edge Padding + 0 + + + 0 + 5 + + + + + voice_horizontal_padding + True + True + 0 + voice_horizontal_padding_adj + + + + 1 + 5 + + + + + voice_show_test_content_label + True + False + Show Test Content + 0 + + + 0 + 7 + + + + + voice_show_test_content + True + True + False + True + + + + 1 + 7 + + + + + voice_dummy_count_label + True + False + Test Data Count + 0 + + + 0 + 8 + + + + + voice_dummy_count + True + True + 50 + voice_dummy_count_adj + 50 + + + + 1 + 8 + + + + + voice_show_disconnected_label + True + False + Show While Disconnected + 0 + + + 0 + 9 + + + + + voice_show_disconnected + True + True + False + True + + + + 1 + 9 + + + + + voce_vertical_padding_label + True + False + Verticle Edge Padding + 0 + + + 0 + 4 + + + + + voice_nick_length_label + True + False + Limit text length + 0 + + + 2 + 4 + + + + + voice_nick_length + True + True + 32 + voice_nick_lenght_adj + 32 + + + + 3 + 4 + + + + + voice_avatar_label + True + False + Show Avatar + 0 + + + 2 + 5 + + + + + voice_show_avatar + True + True + False + True + + + + 3 + 5 + + + + + voice_square_avatar_label + True + False + Square Avatar + 0 + + + 2 + 6 + + + + + voice_square_avatar + True + True + False + True + + + + 3 + 6 + + + + + voice_fancy_avatar_shapes_label + True + False + Fancy Avatar Shapes + 0 + + + 2 + 7 + + + + + voice_fancy_avatar_shapes + True + True + False + True + + + + 3 + 7 + + + + + voice_avatar_size_label + True + False + Avatar Size + 0 + + + 2 + 8 + + + + + voice_avatar_size + True + True + 48 + avatar_size_adj + 48 + + + + 3 + 8 + + + + + voice_avatar_opacity_label + True + False + Avatar Opacity + 0 + + + 2 + 9 + + + + + voice_avatar_opacity + True + True + ava_opacity_adj + 1 + + + + 3 + 9 + + + + + voice_display_speakers_only_label + True + False + Display Speakers Only + 0 + + + 4 + 0 + + + + + voice_display_speakers_only + True + True + False + True + + + + 5 + 0 + + + + + voice_display_speakers_grace_period_label + True + False + Speakers Grace Period + 0 + + + 4 + 1 + + + + + voice_display_speakers_grace_period + True + True + 0 + voice_display_speakers_grace_period_adj + + + + 5 + 1 + + + + + voice_overflow_style_label + True + False + Overflow Style + 0 + + + 4 + 2 + + + + + voice_overflow_style + True + False + + None + Wrap + Shrink + + + + + 5 + 2 + + + + + voice_order_avatars_by_label + True + False + Order Users By + 0 + + + 4 + 3 + + + + + voice_order_avatars_by + True + False + + Alphabetically + ID + Last Spoken + + + + + 5 + 3 + + + + + voice_highlight_self_label + True + False + Highlight Self + 0 + + + 4 + 4 + + + + + voice_highlight_self + True + True + False + True + + + + 5 + 4 + + + + + voice_border_width_label + True + False + Border width + 0 + + + 4 + 5 + + + + + voice_border_width + True + True + 1 + border_width_adj + 1 + + + + 5 + 5 + + + + + voice_icon_spacing_label + True + False + Padding between users + 0 + + + 4 + 6 + + + + + voice_icon_spacing + True + True + 0 + icon_spacing_adj + + + + 5 + 6 + + + + + Reset Voice Settings + voice_reset_all + True + True + True + + + + 5 + 12 + + + + + voice_inactive_fade_label + True + False + Fade out when Inactive + 0 + + + 4 + 7 + + + + + voice_inactive_opacity_label + True + False + Inactive Opacity + 0 + + + 4 + 8 + + + + + voice_inactive_time_label + True + False + Time before Inactive + 0 + + + 4 + 9 + + + + + voice_inactive_fade_time_label + True + False + Time Fading out + 0 + + + 4 + 10 + + + + + voice_inactive_fade + True + True + False + True + + + + 5 + 7 + + + + + voice_inactive_opacity + True + True + voice_inactive_fade_opacity + 1 + + + + 5 + 8 + + + + + voice_inactive_time + True + True + 0 + voice_inactive_time_range + + + + 5 + 9 + + + + + voice_inactive_fade_time + True + True + 0 + voice_inactive_fade_time_range + + + + 5 + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + False + + + + + notebook_voice_adv_label + True + False + Voice - Advanced + + + 2 + False + + @@ -1716,7 +1703,6 @@ 5 1 1 - True text_enable_label @@ -2116,7 +2102,8 @@ - 2 + 3 + False @@ -2127,7 +2114,7 @@ Text - 2 + 3 False @@ -2143,7 +2130,6 @@ 5 1 1 - True notification_enable_label @@ -2604,7 +2590,8 @@ - 3 + 4 + False @@ -2615,7 +2602,7 @@ Notification - 3 + 4 False @@ -2773,7 +2760,6 @@ True False True - 1 @@ -2839,7 +2825,8 @@ - 4 + 5 + False @@ -2850,7 +2837,7 @@ Core - 4 + 5 False diff --git a/discover_overlay/overlay.py b/discover_overlay/overlay.py index 7503f8b..cbe9c4c 100644 --- a/discover_overlay/overlay.py +++ b/discover_overlay/overlay.py @@ -424,17 +424,16 @@ class OverlayWindow(Gtk.Window): """ Set if this overlay should be visible """ - if self.enabled != enabled: - self.enabled = enabled - if enabled and not self.hidden and not self.piggyback_parent: - self.show_all() - self.set_untouchable() - if self.discover.steamos: - self.set_gamescope_xatom(1) - else: - if self.discover.steamos: - self.set_gamescope_xatom(0) - self.hide() + self.enabled = enabled + if enabled and not self.hidden and not self.piggyback_parent: + self.show_all() + self.set_untouchable() + if self.discover.steamos: + self.set_gamescope_xatom(1) + else: + if self.discover.steamos: + self.set_gamescope_xatom(0) + self.hide() def set_task(self, visible): self.set_skip_pager_hint(not visible) diff --git a/discover_overlay/settings_window.py b/discover_overlay/settings_window.py index bba0d1f..9eacd68 100644 --- a/discover_overlay/settings_window.py +++ b/discover_overlay/settings_window.py @@ -46,6 +46,9 @@ class MainSettingsWindow(): self.icon_name = "discover-overlay" self.tray_icon_name = "discover-overlay-tray" + self.spinning_focus = None + self.scale_focus = None + icon_theme = Gtk.IconTheme.get_default() icon_theme.add_resource_path(os.path.expanduser( '~/.local/share/pipx/venvs/discover-overlay/share/icons')) @@ -58,7 +61,6 @@ class MainSettingsWindow(): self.steamos = False self.voice_placement_window = None self.text_placement_window = None - self.voice_advanced = False self.tray = None # Systemtray as fallback self.ind = None # AppIndicator if self.alternative_autostart: @@ -126,7 +128,6 @@ class MainSettingsWindow(): if settings: settings.set_property( "gtk-application-prefer-dark-theme", Gtk.true) - self.widget['notebook'].set_tab_pos(Gtk.PositionType.LEFT) # TODO Not assume the display size. Probably poll it from GDK Display? window.set_default_size(1280, 800) @@ -135,12 +136,16 @@ class MainSettingsWindow(): css.load_from_data(bytes("* { font-size:18px; }", "utf-8")) window.get_style_context().add_provider( css, Gtk.STYLE_PROVIDER_PRIORITY_USER) - - # Space is premium. Sorry Craig - self.widget['voice_advanced_grid'].set_column_homogeneous(False) else: self.widget['overview_close_button'].hide() + self.super_focus = Gtk.CssProvider.new() + self.super_focus.load_from_data( + bytes( + """scale { background-color: rgba(100%, 0%, 0%, 0.3); background-image:unset; } + spinbutton { background-color: rgba(100%, 0%, 0%, 0.3); background-image:unset;} + """, "utf-8")) + screen = window.get_screen() screen_type = "%s" % (screen) self.is_wayland = False @@ -168,6 +173,7 @@ class MainSettingsWindow(): self.populate_guild_menu() builder.connect_signals(self) + window.connect('key-press-event', self.keypress_in_settings) if '--minimized' in self.args: self.start_minimized = True @@ -179,6 +185,93 @@ class MainSettingsWindow(): self.icon_name, Gtk.IconSize.DIALOG) self.widget['window'].set_default_icon_name(self.icon_name) + def keypress_in_settings(self, window, event): + if self.spinning_focus: + match event.keyval: + case Gdk.KEY_Right: + step = self.spinning_focus.get_increments().step + value = self.spinning_focus.get_value() + self.spinning_focus.set_value(value + step) + pass + case Gdk.KEY_Left: + step = self.spinning_focus.get_increments().step + value = self.spinning_focus.get_value() + self.spinning_focus.set_value(value - step) + pass + case Gdk.KEY_Up: + step = self.spinning_focus.get_increments().step + value = self.spinning_focus.get_value() + self.spinning_focus.set_value(value + step) + case Gdk.KEY_Down: + step = self.spinning_focus.get_increments().step + value = self.spinning_focus.get_value() + self.spinning_focus.set_value(value - step) + case Gdk.KEY_space: + self.spinning_focus.get_style_context().remove_provider(self.super_focus) + self.spinning_focus = None + case Gdk.KEY_Escape: + self.spinning_focus.get_style_context().remove_provider(self.super_focus) + + self.spinning_focus = None + elif self.scale_focus: + match event.keyval: + case Gdk.KEY_Right: + value = self.scale_focus.get_value() + self.scale_focus.set_value(value + 0.1) + pass + case Gdk.KEY_Left: + value = self.scale_focus.get_value() + self.scale_focus.set_value(value - 0.1) + pass + case Gdk.KEY_Up: + value = self.scale_focus.get_value() + self.scale_focus.set_value(value + 0.1) + case Gdk.KEY_Down: + value = self.scale_focus.get_value() + self.scale_focus.set_value(value - 0.1) + case Gdk.KEY_space: + self.scale_focus.get_style_context().remove_provider(self.super_focus) + self.scale_focus = None + case Gdk.KEY_Escape: + self.scale_focus.get_style_context().remove_provider(self.super_focus) + self.scale_focus = None + else: + match event.keyval: + case Gdk.KEY_Left: + window.do_move_focus(window, Gtk.DirectionType.LEFT) + case Gdk.KEY_Right: + window.do_move_focus(window, Gtk.DirectionType.RIGHT) + case Gdk.KEY_Up: + window.do_move_focus(window, Gtk.DirectionType.UP) + case Gdk.KEY_Down: + window.do_move_focus(window, Gtk.DirectionType.DOWN) + case Gdk.KEY_F1: + self.widget['notebook'].prev_page() + case Gdk.KEY_F2: + self.widget['notebook'].next_page() + case Gdk.KEY_Escape: + return True + case Gdk.KEY_space: + widget = self.window.get_focus() + if widget: + # I really want there to be a better way... + widget_type = "%s" % (widget) + if 'Gtk.SpinButton' in widget_type: + self.spinning_focus = widget + + widget.get_style_context().add_provider( + self.super_focus, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) + return True + elif 'Gtk.Scale' in widget_type: + self.scale_focus = widget + widget.get_style_context().add_provider( + self.super_focus, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) + return True + return False + case _: + return False + return True + def request_channels_from_guild(self, guild_id): with open(self.rpc_file, 'w') as f: f.write('--rpc --guild-request=%s' % (guild_id)) @@ -284,7 +377,6 @@ class MainSettingsWindow(): def read_config(self): self.loading_config = True - self.widget['voice_advanced_grid'].hide() # Read config and put into gui config = ConfigParser(interpolation=None) @@ -299,10 +391,10 @@ class MainSettingsWindow(): self.voice_floating_h = config.getint( "main", "floating_h", fallback=400) - if config.getboolean("main", "floating", fallback=False): - self.widget['voice_floating_button'].set_active(True) - else: - self.widget['voice_anchor_to_edge_button'].set_active(True) + self.widget['voice_anchor_float'].set_active( + 0 if config.getboolean("main", "floating", fallback=False) else 1) + self.update_floating_ahchor() + self.widget['voice_align_1'].set_active( config.getboolean("main", "rightalign", fallback=False)) self.widget['voice_align_2'].set_active( @@ -438,6 +530,12 @@ class MainSettingsWindow(): self.widget['voice_inactive_fade_time'].set_value( config.getint("main", "inactive_fade_time", fallback=30) ) + self.widget['voice_hide_mouseover'].set_active( + config.getboolean("main", "autohide", fallback=False) + ) + self.widget['voice_show_mouseover'].set_value( + config.getint("main", "autohide_timer", fallback=5) + ) # Read Text section @@ -486,6 +584,13 @@ class MainSettingsWindow(): self.widget['text_line_limit'].set_value( config.getint("text", "line_limit", fallback=20)) + self.widget['text_hide_mouseover'].set_active( + config.getboolean("text", "autohide", fallback=False) + ) + self.widget['text_show_mouseover'].set_value( + config.getint("text", "autohide_timer", fallback=5) + ) + # Read Notification section self.widget['notification_enable'].set_active( config.getboolean("notification", "enabled", fallback=False)) @@ -829,11 +934,20 @@ class MainSettingsWindow(): with open(self.config_file, 'w') as file: config.write(file) - def voice_anchor_to_edge_changed(self, button): - self.config_set("main", "floating", "False") + def voice_anchor_float_changed(self, button): + self.config_set("main", "floating", "%s" % (button.get_active() == 0)) + self.update_floating_ahchor() - def voice_floating_changed(self, button): - self.config_set("main", "floating", "True") + def update_floating_ahchor(self): + floating = self.widget['voice_anchor_float'].get_active() == 0 + if floating: + self.widget['voice_align_1'].hide() + self.widget['voice_align_2'].hide() + self.widget['voice_place_window_button'].show() + else: + self.widget['voice_align_1'].show() + self.widget['voice_align_2'].show() + self.widget['voice_place_window_button'].hide() def voice_monitor_changed(self, button): self.config_set("main", "monitor", "%s" % (button.get_active())) @@ -844,13 +958,6 @@ class MainSettingsWindow(): def voice_align_2_changed(self, button): self.config_set("main", "topalign", "%s" % (button.get_active())) - def voice_show_advanced_options_button_changed(self, button): - self.voice_advanced = not self.voice_advanced - if self.voice_advanced: - self.widget['voice_advanced_grid'].show() - else: - self.widget['voice_advanced_grid'].hide() - def voice_font_changed(self, button): self.config_set("main", "font", button.get_font())