Merge pull request #987 from levacic/feature-gray-minimized-window-titles

Configurable minimized application title font color
This commit is contained in:
Charles Gagnon
2020-05-17 13:11:16 -04:00
committed by GitHub
12 changed files with 86 additions and 1 deletions

View File

@@ -1242,6 +1242,49 @@
</child> </child>
</object> </object>
</child> </child>
<child>
<object class="GtkListBoxRow" id="listbox_group_apps_label_font_color_minimized">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkGrid" id="grid_group_apps_label_font_color_minimized">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="column_spacing">32</property>
<child>
<object class="GtkLabel" id="group_apps_label_font_color_minimized_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Font color of the minimized application titles</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkColorButton" id="group_apps_label_font_color_minimized_colorbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child> <child>
<object class="GtkListBoxRow" id="listbox_group_apps_label_max_width"> <object class="GtkListBoxRow" id="listbox_group_apps_label_max_width">
<property name="visible">True</property> <property name="visible">True</property>

View File

@@ -208,9 +208,13 @@ var taskbarAppIcon = Utils.defineClass({
} }
this._titleWindowChangeId = 0; this._titleWindowChangeId = 0;
this._minimizedWindowChangeId = 0;
} else { } else {
this._titleWindowChangeId = this.window.connect('notify::title', this._titleWindowChangeId = this.window.connect('notify::title',
Lang.bind(this, this._updateWindowTitle)); Lang.bind(this, this._updateWindowTitle));
this._minimizedWindowChangeId = this.window.connect('notify::minimized',
Lang.bind(this, this._updateWindowTitleStyle));
} }
this._scrollEventId = this.actor.connect('scroll-event', this._onMouseScroll.bind(this)); this._scrollEventId = this.actor.connect('scroll-event', this._onMouseScroll.bind(this));
@@ -246,6 +250,7 @@ var taskbarAppIcon = Utils.defineClass({
Me.settings.connect('changed::group-apps-label-font-size', Lang.bind(this, this._updateWindowTitleStyle)), Me.settings.connect('changed::group-apps-label-font-size', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-font-weight', Lang.bind(this, this._updateWindowTitleStyle)), Me.settings.connect('changed::group-apps-label-font-weight', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-font-color', Lang.bind(this, this._updateWindowTitleStyle)), Me.settings.connect('changed::group-apps-label-font-color', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-font-color-minimized', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-label-max-width', Lang.bind(this, this._updateWindowTitleStyle)), Me.settings.connect('changed::group-apps-label-max-width', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-use-fixed-width', Lang.bind(this, this._updateWindowTitleStyle)), Me.settings.connect('changed::group-apps-use-fixed-width', Lang.bind(this, this._updateWindowTitleStyle)),
Me.settings.connect('changed::group-apps-underline-unfocused', Lang.bind(this, this._settingsChangeRefresh)) Me.settings.connect('changed::group-apps-underline-unfocused', Lang.bind(this, this._settingsChangeRefresh))
@@ -307,6 +312,9 @@ var taskbarAppIcon = Utils.defineClass({
if(this._titleWindowChangeId) if(this._titleWindowChangeId)
this.window.disconnect(this._titleWindowChangeId); this.window.disconnect(this._titleWindowChangeId);
if(this._minimizedWindowChangeId)
this.window.disconnect(this._minimizedWindowChangeId);
if (this._windowEnteredMonitorId) { if (this._windowEnteredMonitorId) {
Utils.DisplayWrapper.getScreen().disconnect(this._windowEnteredMonitorId); Utils.DisplayWrapper.getScreen().disconnect(this._windowEnteredMonitorId);
Utils.DisplayWrapper.getScreen().disconnect(this._windowLeftMonitorId); Utils.DisplayWrapper.getScreen().disconnect(this._windowLeftMonitorId);
@@ -476,6 +484,9 @@ var taskbarAppIcon = Utils.defineClass({
let useFixedWidth = Me.settings.get_boolean('group-apps-use-fixed-width'); let useFixedWidth = Me.settings.get_boolean('group-apps-use-fixed-width');
let variableWidth = !useFixedWidth || Panel.checkIfVertical() || this.dtpPanel.taskbar.fullScrollView; let variableWidth = !useFixedWidth || Panel.checkIfVertical() || this.dtpPanel.taskbar.fullScrollView;
let fontWeight = Me.settings.get_string('group-apps-label-font-weight'); let fontWeight = Me.settings.get_string('group-apps-label-font-weight');
let fontColor = this.window.minimized ?
Me.settings.get_string('group-apps-label-font-color-minimized') :
Me.settings.get_string('group-apps-label-font-color');
let scaleFactor = Utils.getScaleFactor(); let scaleFactor = Utils.getScaleFactor();
let maxLabelWidth = Me.settings.get_int('group-apps-label-max-width') * scaleFactor; let maxLabelWidth = Me.settings.get_int('group-apps-label-max-width') * scaleFactor;
@@ -488,7 +499,7 @@ var taskbarAppIcon = Utils.defineClass({
this._windowTitle.set_style('font-size: ' + Me.settings.get_int('group-apps-label-font-size') + 'px;' + this._windowTitle.set_style('font-size: ' + Me.settings.get_int('group-apps-label-font-size') + 'px;' +
'font-weight: ' + fontWeight + ';' + 'font-weight: ' + fontWeight + ';' +
(useFixedWidth ? '' : 'max-width: ' + maxLabelWidth + 'px;') + (useFixedWidth ? '' : 'max-width: ' + maxLabelWidth + 'px;') +
'color: ' + Me.settings.get_string('group-apps-label-font-color')); 'color: ' + fontColor);
} }
}, },

View File

@@ -30,6 +30,7 @@ trans-gradient-top-opacity=1.0
leftbox-size=0 leftbox-size=0
show-showdesktop-button=true show-showdesktop-button=true
group-apps-label-font-color='#ffffff' group-apps-label-font-color='#ffffff'
group-apps-label-font-color-minimized='#ffffff'
intellihide-behaviour='FOCUSED_WINDOWS' intellihide-behaviour='FOCUSED_WINDOWS'
show-favorites=true show-favorites=true
group-apps=true group-apps=true

View File

@@ -30,6 +30,7 @@ trans-gradient-top-opacity=0.0
leftbox-size=0 leftbox-size=0
show-showdesktop-button=true show-showdesktop-button=true
group-apps-label-font-color='#ffffff' group-apps-label-font-color='#ffffff'
group-apps-label-font-color-minimized='#ffffff'
intellihide-behaviour='FOCUSED_WINDOWS' intellihide-behaviour='FOCUSED_WINDOWS'
show-favorites=true show-favorites=true
group-apps=true group-apps=true

View File

@@ -30,6 +30,7 @@ trans-gradient-top-opacity=0.0
leftbox-size=0 leftbox-size=0
show-showdesktop-button=true show-showdesktop-button=true
group-apps-label-font-color='#ffffff' group-apps-label-font-color='#ffffff'
group-apps-label-font-color-minimized='#ffffff'
intellihide-behaviour='FOCUSED_WINDOWS' intellihide-behaviour='FOCUSED_WINDOWS'
show-favorites=true show-favorites=true
group-apps=true group-apps=true

View File

@@ -30,6 +30,7 @@ trans-gradient-top-opacity=0.0
leftbox-size=0 leftbox-size=0
show-showdesktop-button=false show-showdesktop-button=false
group-apps-label-font-color='#ffffff' group-apps-label-font-color='#ffffff'
group-apps-label-font-color-minimized='#ffffff'
intellihide-behaviour='FOCUSED_WINDOWS' intellihide-behaviour='FOCUSED_WINDOWS'
show-favorites=true show-favorites=true
group-apps=false group-apps=false

View File

@@ -1,5 +1,6 @@
[/] [/]
group-apps-label-font-color='#dddddd' group-apps-label-font-color='#dddddd'
group-apps-label-font-color-minimized='#dddddd'
tray-padding=-1 tray-padding=-1
trans-min-panel-opacity=0.32000000000000001 trans-min-panel-opacity=0.32000000000000001
enter-peek-mode-timeout=500 enter-peek-mode-timeout=500

View File

@@ -30,6 +30,7 @@ trans-gradient-top-opacity=0.0
leftbox-size=0 leftbox-size=0
show-showdesktop-button=true show-showdesktop-button=true
group-apps-label-font-color='#ffffff' group-apps-label-font-color='#ffffff'
group-apps-label-font-color-minimized='#ffffff'
intellihide-behaviour='FOCUSED_WINDOWS' intellihide-behaviour='FOCUSED_WINDOWS'
show-favorites=true show-favorites=true
group-apps=true group-apps=true

View File

@@ -30,6 +30,7 @@ trans-gradient-top-opacity=0.90000000000000002
leftbox-size=0 leftbox-size=0
show-showdesktop-button=true show-showdesktop-button=true
group-apps-label-font-color='#ffffff' group-apps-label-font-color='#ffffff'
group-apps-label-font-color-minimized='#ffffff'
intellihide-behaviour='FOCUSED_WINDOWS' intellihide-behaviour='FOCUSED_WINDOWS'
show-favorites=true show-favorites=true
group-apps=true group-apps=true

View File

@@ -1,5 +1,6 @@
[/] [/]
group-apps-label-font-color='#dddddd' group-apps-label-font-color='#dddddd'
group-apps-label-font-color-minimized='#dddddd'
tray-padding=-1 tray-padding=-1
trans-min-panel-opacity=0.32000000000000001 trans-min-panel-opacity=0.32000000000000001
enter-peek-mode-timeout=500 enter-peek-mode-timeout=500

View File

@@ -1282,6 +1282,13 @@ const Settings = new Lang.Class({
this._settings.set_string('group-apps-label-font-color', hexString); this._settings.set_string('group-apps-label-font-color', hexString);
})); }));
this._builder.get_object('group_apps_label_font_color_minimized_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('group-apps-label-font-color-minimized', hexString);
}));
this._settings.bind('group-apps-use-fixed-width', this._settings.bind('group-apps-use-fixed-width',
this._builder.get_object('group_apps_use_fixed_width_switch'), this._builder.get_object('group_apps_use_fixed_width_switch'),
'active', 'active',
@@ -1326,6 +1333,12 @@ const Settings = new Lang.Class({
this._builder.get_object('group_apps_label_font_color_colorbutton').set_rgba(rgba); this._builder.get_object('group_apps_label_font_color_colorbutton').set_rgba(rgba);
}).apply(this); }).apply(this);
(function() {
let rgba = new Gdk.RGBA();
rgba.parse(this._settings.get_string('group-apps-label-font-color-minimized'));
this._builder.get_object('group_apps_label_font_color_minimized_colorbutton').set_rgba(rgba);
}).apply(this);
this._builder.get_object('group_apps_label_max_width_spinbutton').set_value(this._settings.get_int('group-apps-label-max-width')); this._builder.get_object('group_apps_label_max_width_spinbutton').set_value(this._settings.get_int('group-apps-label-max-width'));
this._builder.get_object('group_apps_label_max_width_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { this._builder.get_object('group_apps_label_max_width_spinbutton').connect('value-changed', Lang.bind (this, function(widget) {
this._settings.set_int('group-apps-label-max-width', widget.get_value()); this._settings.set_int('group-apps-label-max-width', widget.get_value());
@@ -1345,6 +1358,11 @@ const Settings = new Lang.Class({
rgba.parse(this._settings.get_string('group-apps-label-font-color')); rgba.parse(this._settings.get_string('group-apps-label-font-color'));
this._builder.get_object('group_apps_label_font_color_colorbutton').set_rgba(rgba); this._builder.get_object('group_apps_label_font_color_colorbutton').set_rgba(rgba);
this._settings.set_value('group-apps-label-font-color-minimized', this._settings.get_default_value('group-apps-label-font-color-minimized'));
let minimizedFontColor = new Gdk.RGBA();
minimizedFontColor.parse(this._settings.get_string('group-apps-label-font-color-minimized'));
this._builder.get_object('group_apps_label_font_color_minimized_colorbutton').set_rgba(minimizedFontColor);
this._settings.set_value('group-apps-label-max-width', this._settings.get_default_value('group-apps-label-max-width')); this._settings.set_value('group-apps-label-max-width', this._settings.get_default_value('group-apps-label-max-width'));
this._builder.get_object('group_apps_label_max_width_spinbutton').set_value(this._settings.get_int('group-apps-label-max-width')); this._builder.get_object('group_apps_label_max_width_spinbutton').set_value(this._settings.get_int('group-apps-label-max-width'));

View File

@@ -562,6 +562,11 @@
<summary>Application title font color</summary> <summary>Application title font color</summary>
<description>When the applications are ungrouped, this defines the application titles font color.</description> <description>When the applications are ungrouped, this defines the application titles font color.</description>
</key> </key>
<key type="s" name="group-apps-label-font-color-minimized">
<default>"#dddddd"</default>
<summary>Minimized application title font color</summary>
<description>When the applications are ungrouped, this defines the titles font color for minimized applications.</description>
</key>
<key type="i" name="group-apps-label-max-width"> <key type="i" name="group-apps-label-max-width">
<default>160</default> <default>160</default>
<summary>Application title max width</summary> <summary>Application title max width</summary>