Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
Made KEY_SHOW_WORKSPACE_LABELS and KEY_SHOW_WORKSPACE_THUMBNAILS work…
Browse files Browse the repository at this point in the history
… together
  • Loading branch information
pakmarkthub authored and zakkak committed May 21, 2019
1 parent fbdf7a6 commit e71e7f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/gridWorkspaceSwitcherPopup.js
Expand Up @@ -180,7 +180,7 @@ class gridWorkspaceSwitcherPopup extends WorkspaceSwitcherPopup.WorkspaceSwitche
prevX = childBox.x2 + this._itemSpacing;

if (this.settings.get_boolean(PrefKeys.KEY_SHOW_WORKSPACE_THUMBNAILS)) {
children[i].child.child.set_scale(tbWScale, tbHScale);
children[i].child.get_children()[0].set_scale(tbWScale, tbHScale);
children[i].child.allocate(childBox, flags);
}
children[i].allocate(childBox, flags);
Expand Down Expand Up @@ -230,7 +230,7 @@ class gridWorkspaceSwitcherPopup extends WorkspaceSwitcherPopup.WorkspaceSwitche
indicator = new St.Bin({ style_class: "ws-switcher-box" });
}
if (this.settings.get_boolean(PrefKeys.KEY_SHOW_WORKSPACE_THUMBNAILS)) {
let tbBox = new St.Bin({
let tbBox = new St.Widget({
clip_to_allocation: true,
style_class: "ws-switcher-tb-box"
});
Expand All @@ -246,7 +246,20 @@ class gridWorkspaceSwitcherPopup extends WorkspaceSwitcherPopup.WorkspaceSwitche
tb.state = WorkspaceThumbnail.ThumbnailState.NORMAL;
tb.actor.clip_to_allocation = false;

tbBox.child = tb.actor;
tbBox.add_child(tb.actor);

if (this.settings.get_boolean(PrefKeys.KEY_SHOW_WORKSPACE_LABELS)) {
let labelBox = new St.Bin({
style_class: "ws-switcher-label-box"
});
let label = new St.Label({
text: name,
style_class: i === this._activeWorkspaceIndex ? "ws-switcher-label-active" : "ws-switcher-label"
});
labelBox.set_child(label);
tbBox.add_child(labelBox);
}

indicator.child = tbBox;
}
else if (this.settings.get_boolean(PrefKeys.KEY_SHOW_WORKSPACE_LABELS)) {
Expand Down
10 changes: 10 additions & 0 deletions src/stylesheet.css
Expand Up @@ -64,11 +64,21 @@
background-color: rgba(32, 96, 152, 0.8);
}

.ws-switcher-label-box {
background-color: rgba(32, 96, 152, 0.8);
padding: 5px;
}

.ws-switcher-label {
color: rgba(255, 255, 255, 0.80);
font-size: 2em;
}

.ws-switcher-label-active {
color: rgba(255, 0, 0, 1);
font-size: 2em;
}

/* Drawn around the workspace we are going to drop on in thumbnails box */
.workspace-thumbnail-drop-indicator {
box-shadow: 0px 0px 4px 6px white;
Expand Down

0 comments on commit e71e7f7

Please sign in to comment.