Use constant for title right padding

This commit is contained in:
Charles Gagnon
2020-05-03 11:22:51 -04:00
parent 08a46105fc
commit a196afa7b0
2 changed files with 5 additions and 11 deletions

View File

@@ -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();

View File

@@ -34,6 +34,7 @@
}
#dashtopanelScrollview .app-well-app .overview-label {
/* must match TITLE_RIGHT_PADDING in apppicons.js */
padding-right: 8px;
}