Skip to content

Commit

Permalink
Workspace switcher: fix buttons sizing (#7495)
Browse files Browse the repository at this point in the history
* In vertical panels, the width wasn't the full panel width as it
   does in horizontal mode and every applet does in vertical mode.

 * In horizontal panels, if a width wasn't defined in CSS the
   labels were hidden because they ellipsized to zero width.

 * Updated default theme to still look the same as it did.
  • Loading branch information
germanfr authored and clefebvre committed Apr 23, 2018
1 parent 81ffa44 commit e4fce2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
16 changes: 8 additions & 8 deletions data/theme/cinnamon.css
Original file line number Diff line number Diff line change
Expand Up @@ -1360,26 +1360,26 @@ StScrollBar StButton#vhandle:hover {
/* Controls the styling when using the "Simple buttons" option */
.panel-top .workspace-switcher,
.panel-bottom .workspace-switcher {
padding-left: 3px;
padding-right: 3px;
padding: 0 3px;
}

.panel-left .workspace-switcher
.panel-left .workspace-switcher,
.panel-right .workspace-switcher {
padding-top: 3px;
padding-bottom: 3px;
padding: 3px;
}

.workspace-button {
width: 20px;
height: 10px;
color: #cccccc;
border: 1px;
border-color: #a6a6a6;
padding-top: 2px;
padding: 0 8px;
transition-duration: 300;
}

.vertical .workspace-button {
padding: 4px 0;
}

.workspace-button:outlined {
background: #cccccc;
color: #555555;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const SignalManager = imports.misc.signalManager;
const Tooltips = imports.ui.tooltips;
const Settings = imports.ui.settings;
const ModalDialog = imports.ui.modalDialog;
const Pango = imports.gi.Pango;

const MIN_SWITCH_INTERVAL_MS = 220;

Expand Down Expand Up @@ -186,14 +187,12 @@ SimpleButton.prototype = {
if (applet.orientation == St.Side.TOP || applet.orientation == St.Side.BOTTOM) {
this.actor.set_height(applet._panelHeight);
} else {
this.actor.set_height(0.6 * applet._panelHeight); // factors are completely empirical
this.actor.set_width(0.9 * applet._panelHeight);
}

if (applet.orientation == St.Side.LEFT || applet.orientation == St.Side.RIGHT)
this.actor.set_width(applet._panelHeight);
this.actor.add_style_class_name('vertical');
}

let label = new St.Label({ text: (index + 1).toString() });
label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
this.actor.set_child(label);
},

Expand Down

0 comments on commit e4fce2e

Please sign in to comment.