mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Use constant for title right padding
This commit is contained in:
15
appIcons.js
15
appIcons.js
@@ -59,10 +59,12 @@ const T4 = 'overviewWindowDragEndTimeout';
|
||||
const T5 = 'switchWorkspaceTimeout';
|
||||
const T6 = 'displayProperIndicatorTimeout';
|
||||
|
||||
//right padding defined for .overview-label in stylesheet.css
|
||||
const TITLE_RIGHT_PADDING = 8;
|
||||
|
||||
let LABEL_GAP = 5;
|
||||
let MAX_INDICATORS = 4;
|
||||
var DEFAULT_PADDING_SIZE = 4;
|
||||
var titleRightPadding = -1;
|
||||
|
||||
let DOT_STYLE = {
|
||||
DOTS: "DOTS",
|
||||
@@ -481,7 +483,7 @@ var taskbarAppIcon = Utils.defineClass({
|
||||
|
||||
this._windowTitle.clutter_text.natural_width = useFixedWidth ? maxLabelWidth : 0;
|
||||
this._windowTitle.clutter_text.natural_width_set = useFixedWidth;
|
||||
this._windowTitle.set_width(variableWidth ? -1 : maxLabelWidth + this._getWindowTitleRightPadding());
|
||||
this._windowTitle.set_width(variableWidth ? -1 : maxLabelWidth + TITLE_RIGHT_PADDING);
|
||||
|
||||
this._windowTitle.set_style('font-size: ' + Me.settings.get_int('group-apps-label-font-size') + 'px;' +
|
||||
'font-weight: ' + fontWeight + ';' +
|
||||
@@ -490,15 +492,6 @@ var taskbarAppIcon = Utils.defineClass({
|
||||
}
|
||||
},
|
||||
|
||||
_getWindowTitleRightPadding: function() {
|
||||
if (this._windowTitle && this._windowTitle.mapped && titleRightPadding < 0) {
|
||||
//get the right padding defined for .overview-label in stylesheet.css
|
||||
titleRightPadding = this._windowTitle.get_theme_node().get_padding(St.Side.RIGHT);
|
||||
}
|
||||
|
||||
return titleRightPadding;
|
||||
},
|
||||
|
||||
_updateWindowTitle: function() {
|
||||
if (this._windowTitle.text != this.window.title) {
|
||||
this._windowTitle.text = (this.window.title ? this.window.title : this.app.get_name()).replace(/\r?\n|\r/g, '').trim();
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
}
|
||||
|
||||
#dashtopanelScrollview .app-well-app .overview-label {
|
||||
/* must match TITLE_RIGHT_PADDING in apppicons.js */
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user