diff --git a/Settings.ui b/Settings.ui index b2bdcb7..4fa4f91 100644 --- a/Settings.ui +++ b/Settings.ui @@ -14,6 +14,48 @@ 0.01 0.10000000000000001 + + True + False + vertical + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + True + Nothing yet! + True + + + + + + + + + False + True + 0 + + + True False @@ -575,182 +617,6 @@ - - True - False - vertical - - - True - False - none - - - True - True - - - True - False - 12 - 12 - 12 - 12 - 32 - - - True - False - True - Show Desktop button width (px) - 0 - - - 0 - 0 - - - - - True - True - 4 - 1 - show_showdesktop_width_adjustment - True - 1 - - - 1 - 0 - - - - - - - - - True - True - - - True - False - 12 - 12 - 12 - 12 - 12 - 32 - - - True - False - True - Reveal the desktop when hovering the Show Desktop button - True - 0 - - - 0 - 0 - - - - - True - True - end - center - - - 1 - 0 - - - - - True - False - 4 - - - True - False - True - Delay before revealing the desktop (ms) - True - 0 - - - 0 - 0 - - - - - True - True - 4 - 1 - show_showdesktop_delay_adjustment - True - 1 - - - 1 - 0 - - - - - True - False - True - Fade duration (ms) - True - 0 - - - 0 - 1 - - - - - True - True - 4 - 1 - show_showdesktop_time_adjustment - True - 1 - - - 1 - 1 - - - - - 0 - 1 - 2 - - - - - - - - - False - True - 2 - - - 10 1 @@ -2269,96 +2135,6 @@ 25 100 - - True - False - vertical - - - True - False - 0 - in - - - True - False - none - - - 100 - 80 - True - True - - - True - False - 12 - 12 - 12 - 12 - 32 - - - True - False - True - Preview timeout on icon leave (ms) - 0 - - - 0 - 0 - - - - - True - False - True - If set too low, the window preview of running applications may seem to close too quickly when trying to enter the popup. If set too high, the preview may linger too long when moving to an adjacent icon. - True - 40 - 0 - - - - 0 - 1 - 2 - - - - - True - True - 4 - 0 - leave_timeout_adjustment - True - - - 1 - 0 - - - - - - - - - - - False - True - 0 - - - 0.33000000000000002 1 @@ -2393,16 +2169,22 @@ 1 5 + + 100 + 800 + 10 + 50 + 9999 25 100 - - 50 - 500 - 10 - 50 + + 6 + 24 + 1 + 100 True @@ -2465,13 +2247,11 @@ - - 100 - 80 + True True - + True False 12 @@ -2480,12 +2260,11 @@ 12 32 - + True False True - Enable window peeking - True + Time (ms) before hiding (100 is default) 0 @@ -2494,157 +2273,12 @@ - - True - True - end - center - - - 1 - 0 - - - - - True - False - True - When hovering over a window preview for some time, the window gets distinguished. - True - 40 - 0 - - - - 0 - 1 - 2 - - - - - - - - - 100 - 80 - True - True - - - True - False - 24 - 12 - 12 - 12 - 32 - - - True - False - True - Enter window peeking mode timeout (ms) - 0 - - - 0 - 0 - - - - - True - False - True - Time of inactivity while hovering over a window preview needed to enter the window peeking mode. - True - 40 - 0 - - - - 0 - 1 - 2 - - - - + True True 4 - enter_peek_mode_timeout_adjustment - True - - - 1 - 0 - - - - - - - - - 100 - 80 - True - True - - - True - False - 24 - 12 - 12 - 12 - 32 - - - True - False - True - Window peeking mode opacity - 0 - - - 0 - 0 - - - - - True - False - True - All windows except for the peeked one have their opacity set to the same value. - True - 40 - 0 - - - - 0 - 1 - 2 - - - - - True - True - 4 - peek_mode_opacity_adjustment + 0 + leave_timeout_adjustment True @@ -2658,8 +2292,6 @@ - 100 - 80 True True @@ -2721,12 +2353,11 @@ - - 100 + True True - + True False 12 @@ -2735,56 +2366,12 @@ 12 32 - - True - False - True - Display window title in previews - True - 0 - - - 0 - 0 - - - - - True - True - end - center - - - 1 - 0 - - - - - - - - - 100 - True - True - - - True - False - 12 - 12 - 12 - 12 - 32 - - + True True 4 0 - preview_width_adjustment + preview_size_adjustment True @@ -2793,57 +2380,11 @@ - + True False True - Width of the window previews (px) - True - 0 - - - 0 - 0 - - - - - - - - - 100 - True - True - - - True - False - 12 - 12 - 12 - 12 - 32 - - - True - True - 4 - 0 - preview_height_adjustment - True - - - 1 - 0 - - - - - True - False - True - Height of the window previews (px) + Window previews size (px) True 0 @@ -2858,7 +2399,6 @@ - 100 True True @@ -2890,7 +2430,7 @@ True False True - Padding of the window previews (px) + Window previews padding (px) True 0 @@ -2903,6 +2443,360 @@ + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Display window preview headers + True + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + + + + + True + False + 20 + 12 + 32 + + + True + True + 4 + 6 + preview_title_font_size_adjustment + True + 6 + + + 1 + 0 + + + + + True + False + True + Font size (px) of the preview titles + True + 0 + + + 0 + 0 + + + + + 0 + 1 + 2 + + + + + True + False + 20 + 12 + 32 + + + True + False + True + Font weight of the preview titles + 0 + + + 0 + 0 + + + + + True + False + center + + inherit from theme + normal + lighter + bold + bolder + + + + 1 + 0 + + + + + 0 + 2 + 2 + + + + + True + False + 20 + 12 + 32 + + + True + False + True + Font color of the preview titles + True + 0 + + + 0 + 0 + + + + + True + True + True + end + + + 1 + 0 + + + + + 0 + 3 + 2 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Enable window peeking + True + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + + + + + True + False + True + When hovering over a window preview for some time, the window gets distinguished. + True + 40 + 0 + + + + 0 + 1 + 2 + + + + + True + False + 20 + 12 + 32 + + + True + False + True + Enter window peeking mode timeout (ms) + 0 + + + 0 + 0 + + + + + True + True + 4 + 50 + enter_peek_mode_timeout_adjustment + True + 50 + + + 1 + 0 + + + + + True + False + True + Time of inactivity while hovering over a window preview needed to enter the window peeking mode. + True + 40 + 0 + + + + 0 + 1 + 2 + + + + + 0 + 2 + 2 + + + + + True + False + 20 + 12 + 32 + + + True + False + True + Window peeking mode opacity + 0 + + + 0 + 0 + + + + + True + True + 4 + 0 + peek_mode_opacity_adjustment + True + + + 1 + 0 + + + + + True + False + True + All windows except for the peeked one have their opacity set to the same value. + True + 40 + 0 + + + + 0 + 1 + 2 + + + + + 0 + 3 + 2 + + + + + + @@ -3399,6 +3293,182 @@ 1 10 + + True + False + vertical + + + True + False + none + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Show Desktop button width (px) + 0 + + + 0 + 0 + + + + + True + True + 4 + 1 + show_showdesktop_width_adjustment + True + 1 + + + 1 + 0 + + + + + + + + + True + True + + + True + False + 12 + 12 + 12 + 12 + 12 + 32 + + + True + False + True + Reveal the desktop when hovering the Show Desktop button + True + 0 + + + 0 + 0 + + + + + True + True + end + center + + + 1 + 0 + + + + + True + False + 4 + + + True + False + True + Delay before revealing the desktop (ms) + True + 0 + + + 0 + 0 + + + + + True + True + 4 + 1 + show_showdesktop_delay_adjustment + True + 1 + + + 1 + 0 + + + + + True + False + True + Fade duration (ms) + True + 0 + + + 0 + 1 + + + + + True + True + 4 + 1 + show_showdesktop_time_adjustment + True + 1 + + + 1 + 1 + + + + + 0 + 1 + 2 + + + + + + + + + False + True + 2 + + + 0.33000000000000002 1 diff --git a/prefs.js b/prefs.js index 3260aae..937ff94 100644 --- a/prefs.js +++ b/prefs.js @@ -990,6 +990,13 @@ const Settings = new Lang.Class({ 'active', Gio.SettingsBindFlags.DEFAULT); + this._builder.get_object('grid_preview_title_font_color_colorbutton').connect('notify::color', Lang.bind(this, function (button) { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('window-preview-title-font-color', hexString); + })); + this._builder.get_object('show_window_previews_button').connect('clicked', Lang.bind(this, function() { let dialog = new Gtk.Dialog({ title: _('Window preview options'), @@ -1009,47 +1016,59 @@ const Settings = new Lang.Class({ this._settings.set_int('show-window-previews-timeout', widget.get_value()); })); - this._settings.bind('peek-mode', - this._builder.get_object('peek_mode_switch'), - 'active', - Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('window-preview-show-title', - this._builder.get_object('preview_show_title_switch'), - 'active', - Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('peek-mode', - this._builder.get_object('listboxrow_enter_peek_mode_timeout'), - 'sensitive', - Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('peek-mode', - this._builder.get_object('listboxrow_peek_mode_opacity'), - 'sensitive', - Gio.SettingsBindFlags.DEFAULT); this._settings.bind('preview-middle-click-close', this._builder.get_object('preview_middle_click_close_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._builder.get_object('enter_peek_mode_timeout_spinbutton').set_value(this._settings.get_int('enter-peek-mode-timeout')); + this._settings.bind('peek-mode', + this._builder.get_object('peek_mode_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('peek-mode', + this._builder.get_object('grid_enter_peek_mode_timeout'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('peek-mode', + this._builder.get_object('grid_peek_mode_opacity'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('window-preview-show-title', + this._builder.get_object('preview_show_title_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_title_size'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_title_weight'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_title_font_color'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._builder.get_object('enter_peek_mode_timeout_spinbutton').set_value(this._settings.get_int('enter-peek-mode-timeout')); this._builder.get_object('enter_peek_mode_timeout_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { this._settings.set_int('enter-peek-mode-timeout', widget.get_value()); })); - this._builder.get_object('peek_mode_opacity_spinbutton').set_value(this._settings.get_int('peek-mode-opacity')); + this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + this._builder.get_object('leave_timeout_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { + this._settings.set_int('leave-timeout', widget.get_value()); + })); + this._builder.get_object('peek_mode_opacity_spinbutton').set_value(this._settings.get_int('peek-mode-opacity')); this._builder.get_object('peek_mode_opacity_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { this._settings.set_int('peek-mode-opacity', widget.get_value()); })); - this._builder.get_object('preview_width_spinbutton').set_value(this._settings.get_int('window-preview-width')); - this._builder.get_object('preview_width_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { - this._settings.set_int('window-preview-width', widget.get_value()); - })); - - this._builder.get_object('preview_height_spinbutton').set_value(this._settings.get_int('window-preview-height')); - this._builder.get_object('preview_height_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { - this._settings.set_int('window-preview-height', widget.get_value()); + this._builder.get_object('preview_size_spinbutton').set_value(this._settings.get_int('window-preview-size')); + this._builder.get_object('preview_size_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { + this._settings.set_int('window-preview-size', widget.get_value()); })); this._builder.get_object('preview_padding_spinbutton').set_value(this._settings.get_int('window-preview-padding')); @@ -1057,12 +1076,31 @@ const Settings = new Lang.Class({ this._settings.set_int('window-preview-padding', widget.get_value()); })); + this._builder.get_object('preview_title_size_spinbutton').set_value(this._settings.get_int('window-preview-title-font-size')); + this._builder.get_object('preview_title_size_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { + this._settings.set_int('window-preview-title-font-size', widget.get_value()); + })); + + this._builder.get_object('grid_preview_title_weight_combo').set_active_id(this._settings.get_string('window-preview-title-font-weight')); + this._builder.get_object('grid_preview_title_weight_combo').connect('changed', Lang.bind (this, function(widget) { + this._settings.set_string('window-preview-title-font-weight', widget.get_active_id()); + })); + + (function() { + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('window-preview-title-font-color')); + this._builder.get_object('grid_preview_title_font_color_colorbutton').set_rgba(rgba); + }).apply(this); + dialog.connect('response', Lang.bind(this, function(dialog, id) { if (id == 1) { // restore default settings this._settings.set_value('show-window-previews-timeout', this._settings.get_default_value('show-window-previews-timeout')); this._builder.get_object('preview_timeout_spinbutton').set_value(this._settings.get_int('show-window-previews-timeout')); + this._settings.set_value('leave-timeout', this._settings.get_default_value('leave-timeout')); + this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + this._settings.set_value('peek-mode', this._settings.get_default_value('peek-mode')); this._settings.set_value('window-preview-show-title', this._settings.get_default_value('window-preview-show-title')); this._settings.set_value('enter-peek-mode-timeout', this._settings.get_default_value('enter-peek-mode-timeout')); @@ -1070,17 +1108,25 @@ const Settings = new Lang.Class({ this._settings.set_value('peek-mode-opacity', this._settings.get_default_value('peek-mode-opacity')); this._builder.get_object('peek_mode_opacity_spinbutton').set_value(this._settings.get_int('peek-mode-opacity')); - this._settings.set_value('window-preview-width', this._settings.get_default_value('window-preview-width')); - this._builder.get_object('preview_width_spinbutton').set_value(this._settings.get_int('window-preview-width')); + this._settings.set_value('window-preview-size', this._settings.get_default_value('window-preview-size')); + this._builder.get_object('preview_size_spinbutton').set_value(this._settings.get_int('window-preview-size')); - this._settings.set_value('window-preview-height', this._settings.get_default_value('window-preview-height')); - this._builder.get_object('preview_height_spinbutton').set_value(this._settings.get_int('window-preview-height')); - this._settings.set_value('window-preview-padding', this._settings.get_default_value('window-preview-padding')); this._builder.get_object('preview_padding_spinbutton').set_value(this._settings.get_int('window-preview-padding')); this._settings.set_value('preview-middle-click-close', this._settings.get_default_value('preview-middle-click-close')); + this._settings.set_value('window-preview-title-font-size', this._settings.get_default_value('window-preview-title-font-size')); + this._builder.get_object('preview_title_size_spinbutton').set_value(this._settings.get_int('window-preview-title-font-size')); + + this._settings.set_value('window-preview-title-font-weight', this._settings.get_default_value('window-preview-title-font-weight')); + this._builder.get_object('grid_preview_title_weight_combo').set_active_id(this._settings.get_string('window-preview-title-font-weight')); + + this._settings.set_value('window-preview-title-font-color', this._settings.get_default_value('window-preview-title-font-color')); + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('window-preview-title-font-color')); + this._builder.get_object('grid_preview_title_font_color_colorbutton').set_rgba(rgba); + } else { // remove the settings box so it doesn't get destroyed; dialog.get_content_area().remove(box); @@ -1414,17 +1460,10 @@ const Settings = new Lang.Class({ let box = this._builder.get_object('box_advanced_options'); dialog.get_content_area().add(box); - this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); - - this._builder.get_object('leave_timeout_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { - this._settings.set_int('leave-timeout', widget.get_value()); - })); - dialog.connect('response', Lang.bind(this, function(dialog, id) { if (id == 1) { // restore default settings - this._settings.set_value('leave-timeout', this._settings.get_default_value('leave-timeout')); - this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + } else { // remove the settings box so it doesn't get destroyed; dialog.get_content_area().remove(box); diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index 21b3dc1..fdcf2dd 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -410,23 +410,28 @@ Display title in preview Display window title in preview + + "#dddddd" + Window previews title font color + This defines the Window previews titles font color. + + + 14 + Window previews title font size + This defines the Window previews titles font size. + + + 'inherit' + Font weight of window preview titles + This defines the font weight of window preview titles. Supported values: inherit (from theme), normal, lighter, bold and bolder. + 240 Window previews size Preferred window previews size - - 350 - Window previews width - The width of the window previews - - - 200 - Window previews height - The height of the window previews - - 20 + 8 Window previews padding The padding of the window previews diff --git a/windowPreview.js b/windowPreview.js index 7c349f8..d4b17f6 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -720,35 +720,31 @@ var Preview = Utils.defineClass({ if (headerHeight) { let iconTextureSize = headerHeight / scaleFactor * .6; let icon = this._previewMenu.getCurrentAppIcon().app.create_icon_texture(iconTextureSize); - let windowTitleStyle = 'max-width: 0px;'; + let workspaceIndex = ''; + let workspaceStyle = null; + let commonTitleStyles = 'color: ' + this._previewMenu._dtpSettings.get_string('window-preview-title-font-color') + ';' + + 'font-size: ' + this._previewMenu._dtpSettings.get_int('window-preview-title-font-size') + 'px;' + + 'font-weight: ' + this._previewMenu._dtpSettings.get_string('window-preview-title-font-weight') + ';'; this._iconBin.destroy_all_children(); this._iconBin.add_child(icon); - if (isLeftButtons) { - windowTitleStyle += 'padding-left:' + (headerHeight - icon.width) * .5 + 'px;'; + if (!this._previewMenu._dtpSettings.get_boolean('isolate-workspaces')) { + workspaceIndex = (this.window.get_workspace().index() + 1).toString(); + workspaceStyle = 'margin: 0 4px 0 ' + (isLeftButtons ? Math.round((headerHeight - icon.width) * .5) + 'px' : '0') + '; padding: 0 4px;' + + 'border: 2px solid ' + this._getRgbaColor(FOCUSED_COLOR_OFFSET, .8) + 'border-radius: 2px;' + commonTitleStyles; } + + this._workspaceIndicator.text = workspaceIndex; + this._workspaceIndicator.set_style(workspaceStyle); this._titleWindowChangeId = this.window.connect('notify::title', () => this._updateWindowTitle()); - - this._windowTitle.set_style(windowTitleStyle); + this._windowTitle.set_style('max-width: 0px; padding-right: 4px;' + commonTitleStyles); this._updateWindowTitle(); } }, _updateWindowTitle: function() { - let workspaceIndex = ''; - let workspaceStyle = null; - - if (!this._previewMenu._dtpSettings.get_boolean('isolate-workspaces')) { - workspaceIndex = (this.window.get_workspace().index() + 1).toString(); - workspaceStyle = 'padding: 0 4px; border: 2px solid ' + this._getRgbaColor(FOCUSED_COLOR_OFFSET, .8) + - 'border-radius: 2px; margin-right: 4px;'; - } - - this._workspaceIndicator.text = workspaceIndex; - this._workspaceIndicator.set_style(workspaceStyle); - this._windowTitle.text = this.window.title; },