mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Merge branch 'master' into show-desktop-color
This commit is contained in:
98
Settings.ui
98
Settings.ui
@@ -2096,6 +2096,12 @@
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">100</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="preview_custom_icon_size_adjustment">
|
||||
<property name="lower">8</property>
|
||||
<property name="upper">48</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">100</property>
|
||||
</object>
|
||||
<object class="GtkScrolledWindow" id="box_window_preview_options">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
@@ -2747,6 +2753,92 @@
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid_preview_custom_icon_size">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_top">12</property>
|
||||
<property name="column_spacing">32</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="preview_custom_icon_size_switch">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="preview_custom_icon_size_spinbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="width_chars">4</property>
|
||||
<property name="text">6</property>
|
||||
<property name="adjustment">preview_custom_icon_size_adjustment</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="value">6</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="preview_custom_icon_size_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Icon size (px) of the window preview</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="GtkLabel" id="preview_custom_icon_size_description">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">If disabled, the previews icon size will be based on headerbar size</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="max_width_chars">40</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid_preview_title_size">
|
||||
<property name="visible">True</property>
|
||||
@@ -2786,7 +2878,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -2831,7 +2923,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -2870,7 +2962,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
22
prefs.js
22
prefs.js
@@ -1197,6 +1197,14 @@ const Settings = new Lang.Class({
|
||||
this._builder.get_object('preview_custom_opacity_spinbutton'),
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT);
|
||||
this._settings.bind('window-preview-use-custom-icon-size',
|
||||
this._builder.get_object('preview_custom_icon_size_switch'),
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT);
|
||||
this._settings.bind('window-preview-use-custom-icon-size',
|
||||
this._builder.get_object('preview_custom_icon_size_spinbutton'),
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT);
|
||||
|
||||
this._builder.get_object('preview_custom_opacity_spinbutton').set_value(this._settings.get_int('preview-custom-opacity'));
|
||||
this._builder.get_object('preview_custom_opacity_spinbutton').connect('value-changed', Lang.bind (this, function(widget) {
|
||||
@@ -1220,6 +1228,10 @@ const Settings = new Lang.Class({
|
||||
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_custom_icon_size'),
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT);
|
||||
this._settings.bind('window-preview-show-title',
|
||||
this._builder.get_object('grid_preview_title_size'),
|
||||
'sensitive',
|
||||
@@ -1282,6 +1294,11 @@ const Settings = new Lang.Class({
|
||||
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('preview_custom_icon_size_spinbutton').set_value(this._settings.get_int('window-preview-custom-icon-size'));
|
||||
this._builder.get_object('preview_custom_icon_size_spinbutton').connect('value-changed', Lang.bind (this, function(widget) {
|
||||
this._settings.set_int('window-preview-custom-icon-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) {
|
||||
@@ -1309,6 +1326,8 @@ const Settings = new Lang.Class({
|
||||
this._builder.get_object('animation_time_spinbutton').set_value(this._settings.get_int('window-preview-animation-time'));
|
||||
|
||||
this._settings.set_value('preview-use-custom-opacity', this._settings.get_default_value('preview-use-custom-opacity'));
|
||||
|
||||
this._settings.set_value('window-preview-use-custom-icon-size', this._settings.get_default_value('window-preview-use-custom-icon-size'));
|
||||
|
||||
this._settings.set_value('preview-custom-opacity', this._settings.get_default_value('preview-custom-opacity'));
|
||||
this._builder.get_object('preview_custom_opacity_spinbutton').set_value(this._settings.get_int('preview-custom-opacity'));
|
||||
@@ -1342,6 +1361,9 @@ const Settings = new Lang.Class({
|
||||
|
||||
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-custom-icon-size', this._settings.get_default_value('window-preview-custom-icon-size'));
|
||||
this._builder.get_object('preview_custom_icon_size_spinbutton').set_value(this._settings.get_int('window-preview-custom-icon-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'));
|
||||
|
||||
@@ -407,11 +407,6 @@
|
||||
<summary>Show activities button</summary>
|
||||
<description>Show activities button on the left hand side of the taskbar</description>
|
||||
</key>
|
||||
<key type="b" name="show-showdesktop-button">
|
||||
<default>true</default>
|
||||
<summary>Show desktop button</summary>
|
||||
<description>Show button on right side of bar that minimizes/restores all visible windows on current workspace</description>
|
||||
</key>
|
||||
<key type="i" name="showdesktop-button-width">
|
||||
<default>8</default>
|
||||
<summary>Width of show Desktop button</summary>
|
||||
@@ -492,6 +487,16 @@
|
||||
<summary>Window previews title font size</summary>
|
||||
<description>This defines the window preview titles font size.</description>
|
||||
</key>
|
||||
<key type="b" name="window-preview-use-custom-icon-size">
|
||||
<default>false</default>
|
||||
<summary>Window previews use custom icon size</summary>
|
||||
<description>Window previews use custom application icon size.</description>
|
||||
</key>
|
||||
<key type="i" name="window-preview-custom-icon-size">
|
||||
<default>16</default>
|
||||
<summary>Window previews custom icon size</summary>
|
||||
<description>Window previews custom application icon size.</description>
|
||||
</key>
|
||||
<key type="i" name="window-preview-animation-time">
|
||||
<default>260</default>
|
||||
<summary>Window previews animation time</summary>
|
||||
|
||||
@@ -114,12 +114,12 @@
|
||||
spacing: 0px;
|
||||
}
|
||||
|
||||
.showdesktop-button {
|
||||
border: 0 solid rgba(200, 200, 200, .2);
|
||||
.showdesktop-button-dark-hovered {
|
||||
background-color: rgba(200, 200, 200, .4);
|
||||
}
|
||||
|
||||
.showdesktop-button-hovered {
|
||||
background-color: rgba(200, 200, 200, .4);
|
||||
.showdesktop-button-light-hovered {
|
||||
background-color: rgba(55, 55, 55, .4);
|
||||
}
|
||||
|
||||
.panel-corner.hidden:active, .panel-corner.hidden:overview, .panel-corner.hidden:focus {
|
||||
|
||||
17
utils.js
17
utils.js
@@ -377,14 +377,18 @@ var removeKeybinding = function(key) {
|
||||
}
|
||||
};
|
||||
|
||||
var getrgbColor = function(color) {
|
||||
color = typeof color === 'string' ? Clutter.color_from_string(color)[1] : color;
|
||||
|
||||
return { red: color.red, green: color.green, blue: color.blue };
|
||||
};
|
||||
|
||||
var getrgbaColor = function(color, alpha, offset) {
|
||||
if (alpha <= 0) {
|
||||
return 'transparent; ';
|
||||
}
|
||||
|
||||
color = typeof color === 'string' ? Clutter.color_from_string(color)[1] : color;
|
||||
|
||||
let rgb = { red: color.red, green: color.green, blue: color.blue };
|
||||
let rgb = getrgbColor(color);
|
||||
|
||||
if (offset) {
|
||||
['red', 'green', 'blue'].forEach(k => {
|
||||
@@ -399,6 +403,13 @@ var getrgbaColor = function(color, alpha, offset) {
|
||||
return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + (Math.floor(alpha * 100) * 0.01) + '); ' ;
|
||||
};
|
||||
|
||||
var checkIfColorIsBright = function(color) {
|
||||
let rgb = getrgbColor(color);
|
||||
let brightness = 0.2126 * rgb.red + 0.7152 * rgb.green + 0.0722 * rgb.blue;
|
||||
|
||||
return brightness > 128;
|
||||
};
|
||||
|
||||
var getMouseScrollDirection = function(event) {
|
||||
let direction;
|
||||
|
||||
|
||||
@@ -948,7 +948,9 @@ var Preview = Utils.defineClass({
|
||||
|
||||
_updateHeader: function() {
|
||||
if (headerHeight) {
|
||||
let iconTextureSize = headerHeight / scaleFactor * .6;
|
||||
let iconTextureSize = Me.settings.get_boolean('window-preview-use-custom-icon-size') ?
|
||||
Me.settings.get_int('window-preview-custom-icon-size') :
|
||||
headerHeight / scaleFactor * .6;
|
||||
let icon = this._previewMenu.getCurrentAppIcon().app.create_icon_texture(iconTextureSize);
|
||||
let workspaceIndex = '';
|
||||
let workspaceStyle = null;
|
||||
@@ -1142,4 +1144,4 @@ function getTweenOpts(opts) {
|
||||
};
|
||||
|
||||
return Utils.mergeObjects(opts || {}, defaults);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user