Skip to content

Commit

Permalink
tasks container width
Browse files Browse the repository at this point in the history
  • Loading branch information
zpydr committed Mar 20, 2016
1 parent 340ea5e commit eec41d6
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Resize panels + contents
Top/bottom panel background color + opacity
Bottom panel tray button - activate the message tray
Tasks on all workspaces
Tasks Label
Tasks label
Tasks application menu
Close tasks with a right/middle click
Activate tasks on hover
Expand Down
27 changes: 17 additions & 10 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ TaskBar.prototype =
if (! this.settings.get_boolean("workspace-selector"))
{
ThumbnailsSlider._getAlwaysZoomOut = this.alwaysZoomOut;
ThumbnailsSlider.getNonExpandedWidth = this.nonExpandedWidth;
ThumbnailsSlider.getNonExpandedWidth = this.nonExpandedWidth;
}

//Disconnect Workspace Signals
Expand Down Expand Up @@ -1858,7 +1858,8 @@ TaskBar.prototype =
this.inactiveTaskFrame();
//Task Menu
this.taskMenu = null;
this.taskMenuUp = false;
this.taskMenuUp = false;
this.tasksContainerSize();
this.windows = new Windows.Windows(this, this.onWindowsListChanged, this.onWindowChanged);
}
},
Expand Down Expand Up @@ -1910,6 +1911,20 @@ TaskBar.prototype =
}
},

//Tasks Container Size
tasksContainerSize: function()
{
let spaces = this.settings.get_int("tasks-spaces");
let buttonTaskWidth = 0;
this.tasksWidth = this.settings.get_int("tasks-width");
if (this.settings.get_boolean("tasks-label"))
buttonTaskWidth = this.tasksWidth;
else
buttonTaskWidth = (this.iconSize + 8);
this.newTasksContainerWidth = (this.tasksContainerWidth * (buttonTaskWidth + spaces));
this.boxMainTasks.set_width(this.newTasksContainerWidth);
},

//Active Tasks
activeTasks: function(window)
{
Expand Down Expand Up @@ -2058,16 +2073,8 @@ TaskBar.prototype =
buttonTask.add_style_pseudo_class(this.inactiveTask);
buttonTask.set_style(this.inactiveBackgroundStyleColor);
}
let spaces = this.settings.get_int("tasks-spaces");
let buttonTaskWidth = 0;
if (this.settings.get_boolean("tasks-label"))
buttonTaskWidth = buttonTask.get_width();
else
buttonTaskWidth = (this.iconSize + 8);
this.newTasksContainerWidth = (this.tasksContainerWidth * (buttonTaskWidth + spaces));
if ((buttonTask.visible) || (this.settings.get_boolean("tasks-all-workspaces")))
this.countTasks ++;
this.boxMainTasks.set_width(this.newTasksContainerWidth);
this.boxMainTasks.add_actor(buttonTask);
this.tasksList.push([ window, buttonTask, signalsTask, labelTask ]);
}
Expand Down
14 changes: 7 additions & 7 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"_generated": "Generated by SweetTooth, do not edit",
"description": "TaskBar displays icons of running applications on the top panel or alternatively on a new bottom panel. Activate, minimize or close tasks with a simple click.\nTaskBar is a dock-like windows list on the top/bottom bar.\n\nOptions:\nDesktop button - toggle desktop view\nWorkspace button - switch workspaces left/right-click: cycle forward/backwards\nAppview button - left/right-click: toggle appview/overview\nFavorites - add from dash\nAlign position\nResize panels + contents\nTop/bottom panel background color + opacity\nBottom panel tray button - activate the message tray\nTasks on all workspaces\nTasks label\nTasks application menu\nClose tasks with a right/middle click\nActivate tasks on hover\nScroll tasks/workspaces\nSeparators\nThumbnail/label-preview\nColor or hide menu buttons\nDisable hot corner\n\nVersion 47 for GNOME 3.10 - 3.18\[email protected]\n\nLanguage support:\nCzech by michal-ruzicka\nFrench by narzb\nGerman by jonnius\n\nCredit to Xes, flubshi, rogst, Baltix, boennhoff, skoslowski, rgeary1, hkskoglund, michal-ruzicka, skochxxl, tuhaihe, to-ba",
"name": "TaskBar",
"shell-version": [
"_generated": "Generated by SweetTooth, do not edit",
"description": "TaskBar displays icons of running applications on the top panel or alternatively on a new bottom panel. Activate, minimize or close tasks with a simple click.\nTaskBar is a dock-like windows list on the top/bottom bar.\n\nOptions:\nDesktop button - toggle desktop view\nWorkspace button - switch workspaces left/right-click: cycle forward/backwards\nAppview button - left/right-click: toggle appview/overview\nFavorites - add from dash\nAlign position\nResize panels + contents\nTop/bottom panel background color + opacity\nBottom panel tray button - activate the message tray\nTasks on all workspaces\nTasks label\nTasks application menu\nClose tasks with a right/middle click\nActivate tasks on hover\nScroll tasks/workspaces\nSeparators\nThumbnail/label-preview\nColor or hide menu buttons\nDisable hot corner\n\nVersion 47 for GNOME 3.10 - 3.18\[email protected]\n\nLanguage support:\nCzech by michal-ruzicka\nFrench by narzb\nGerman by jonnius\n\nCredit to Xes, flubshi, rogst, Baltix, boennhoff, skoslowski, rgeary1, hkskoglund, michal-ruzicka, skochxxl, tuhaihe, to-ba",
"name": "TaskBar",
"shell-version": [
"3.10",
"3.12",
"3.14",
"3.16",
"3.18"
],
"url": "https://github.com/zpydr/gnome-shell-extension-taskbar",
"uuid": "TaskBar@zpydr",
],
"url": "https://github.com/zpydr/gnome-shell-extension-taskbar",
"uuid": "TaskBar@zpydr",
"version": 47
}
28 changes: 14 additions & 14 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ Prefs.prototype =
this.gridTrayButton.attach(labelSpaceTrayButton4, 0, 0, 7, 1);
let labelSpaceTrayButton5 = new Gtk.Label({label: "\t", xalign: 0});
this.gridTrayButton.attach(labelSpaceTrayButton5, 6, 1, 1, 1);

this.gridSeparator = new Gtk.Grid();
this.gridSeparator.margin = this.gridSeparator.row_spacing = 10;
this.gridSeparator.column_spacing = 2;
Expand Down Expand Up @@ -1079,7 +1079,7 @@ Prefs.prototype =
let labelSpaceGPL4 = new Gtk.Label({label: "\t", xalign: 0});
this.gridGPL.attach(labelSpaceGPL4, 3, 4, 1, 1);

notebook.set_current_page(1);
notebook.set_current_page(1);
notebook.show_all();
return notebook;
},
Expand Down Expand Up @@ -1657,62 +1657,62 @@ Prefs.prototype =

changeSeparatorLeftBoxMain: function(object)
{
this.settings.set_int("separator-left-box-main", this.valueSeparatorLeftBoxMain.get_value());
this.settings.set_int("separator-left-box-main", this.valueSeparatorLeftBoxMain.get_value());
},

changeSeparatorRightBoxMain: function(object)
{
this.settings.set_int("separator-right-box-main", this.valueSeparatorRightBoxMain.get_value());
this.settings.set_int("separator-right-box-main", this.valueSeparatorRightBoxMain.get_value());
},

changeSeparatorLeftTasks: function(object)
{
this.settings.set_int("separator-left-tasks", this.valueSeparatorLeftTasks.get_value());
this.settings.set_int("separator-left-tasks", this.valueSeparatorLeftTasks.get_value());
},

changeSeparatorRightTasks: function(object)
{
this.settings.set_int("separator-right-tasks", this.valueSeparatorRightTasks.get_value());
this.settings.set_int("separator-right-tasks", this.valueSeparatorRightTasks.get_value());
},

changeSeparatorLeftDesktop: function(object)
{
this.settings.set_int("separator-left-desktop", this.valueSeparatorLeftDesktop.get_value());
this.settings.set_int("separator-left-desktop", this.valueSeparatorLeftDesktop.get_value());
},

changeSeparatorRightDesktop: function(object)
{
this.settings.set_int("separator-right-desktop", this.valueSeparatorRightDesktop.get_value());
this.settings.set_int("separator-right-desktop", this.valueSeparatorRightDesktop.get_value());
},

changeSeparatorLeftWorkspaces: function(object)
{
this.settings.set_int("separator-left-workspaces", this.valueSeparatorLeftWorkspaces.get_value());
this.settings.set_int("separator-left-workspaces", this.valueSeparatorLeftWorkspaces.get_value());
},

changeSeparatorRightWorkspaces: function(object)
{
this.settings.set_int("separator-right-workspaces", this.valueSeparatorRightWorkspaces.get_value());
this.settings.set_int("separator-right-workspaces", this.valueSeparatorRightWorkspaces.get_value());
},

changeSeparatorLeftAppview: function(object)
{
this.settings.set_int("separator-left-appview", this.valueSeparatorLeftAppview.get_value());
this.settings.set_int("separator-left-appview", this.valueSeparatorLeftAppview.get_value());
},

changeSeparatorRightAppview: function(object)
{
this.settings.set_int("separator-right-appview", this.valueSeparatorRightAppview.get_value());
this.settings.set_int("separator-right-appview", this.valueSeparatorRightAppview.get_value());
},

changeSeparatorLeftFavorites: function(object)
{
this.settings.set_int("separator-left-favorites", this.valueSeparatorLeftFavorites.get_value());
this.settings.set_int("separator-left-favorites", this.valueSeparatorLeftFavorites.get_value());
},

changeSeparatorRightFavorites: function(object)
{
this.settings.set_int("separator-right-favorites", this.valueSeparatorRightFavorites.get_value());
this.settings.set_int("separator-right-favorites", this.valueSeparatorRightFavorites.get_value());
},

changeDisplayActivitiesButton: function(object, pspec)
Expand Down
2 changes: 1 addition & 1 deletion schemas/org.gnome.shell.extensions.TaskBar.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
<default>0</default>
<summary>Workspace Indicator Right Separator</summary>
<description/>
</key>
</key>
<key name="separator-left-desktop" type="i">
<range min="0" max="1000"/>
<default>0</default>
Expand Down
6 changes: 3 additions & 3 deletions stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
[email protected]
*/

Expand Down

0 comments on commit eec41d6

Please sign in to comment.