Skip to content

Commit

Permalink
Merge pull request linuxmint#543 from jaszhix/cinnamenu
Browse files Browse the repository at this point in the history
Cinnamenu: v1.2.2
  • Loading branch information
brownsr committed May 2, 2017
2 parents e518f26 + c5bc759 commit 6e978fd
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 81 deletions.
15 changes: 7 additions & 8 deletions Cinnamenu@json/files/Cinnamenu@json/3.2/applet.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ========================================================================================================
* applet.js - Cinnamenu extension
* --------------------------------------------------------------------------------------------------------
* CREDITS:
* CREDITS:
* Forked from Gnomenu by The Panacea Projects - https://github.com/The-Panacea-Projects/Gnomenu.
* Ported to Cinnamon by Jason Hicks.
* A large part of this code was copied from the Mint menu and Axe menu extensions. Many thanks
Expand Down Expand Up @@ -150,13 +150,13 @@ CinnamenuButton.prototype = {
if (this.menuIcon === '') {
this.set_applet_icon_name('');
} else if (GLib.path_is_absolute(this.menuIcon) && GLib.file_test(this.menuIcon, GLib.FileTest.EXISTS)) {
if (this.menuIcon.search('-symbolic') != -1) {
if (this.menuIcon.search('-symbolic') !== -1) {
this.set_applet_icon_symbolic_path(this.menuIcon);
} else {
this.set_applet_icon_path(this.menuIcon);
}
} else if (Gtk.IconTheme.get_default().has_icon(this.menuIcon)) {
if (this.menuIcon.search('-symbolic') != -1) {
if (this.menuIcon.search('-symbolic') !== -1) {
this.set_applet_icon_symbolic_name(this.menuIcon);
} else {
this.set_applet_icon_name(this.menuIcon);
Expand All @@ -175,13 +175,12 @@ CinnamenuButton.prototype = {
this._applet_icon_box.show();
}

if (this.orientation == St.Side.LEFT || this.orientation == St.Side.RIGHT) // no menu label if in a vertical panel
{
if (this.orientation === St.Side.LEFT || this.orientation === St.Side.RIGHT) {
this.set_applet_label('');
} else {
if (this.panelMenuLabelText !== '') {
this.set_applet_label(_(this.menuLabel)); // TBD
this.set_applet_tooltip(_(this.menuLabel));
if (!this.panelMenuLabelText || this.panelMenuLabelText.length > 0) {
this.set_applet_label(this.menuLabel); // TBD
this.set_applet_tooltip(this.menuLabel);
} else {
this.set_applet_label('');
}
Expand Down
2 changes: 1 addition & 1 deletion Cinnamenu@json/files/Cinnamenu@json/3.2/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ AppListGridButton.prototype = {
}
}
}
this.toggleMenu(this._parent._applet.startupViewMod === ApplicationsViewMode.LIST);
this.toggleMenu(this._parent._applet.startupViewMode === ApplicationsViewMode.LIST);
},

setColumn: function(column) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 25 additions & 31 deletions Cinnamenu@json/files/Cinnamenu@json/3.2/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,11 @@ CinnamenuPanel.prototype = {
_listApplications: function(category_menu_id, pattern) {
let appList = [];

if (category_menu_id == 'all') {
if (category_menu_id === 'all') {
for (let directory in this.applicationsByCategory) {
appList = appList.concat(this.applicationsByCategory[directory]);
}
} else if (category_menu_id == 'favorites') {
} else if (category_menu_id === 'favorites') {
appList = this.favorites;
} else {
if (category_menu_id) {
Expand Down Expand Up @@ -788,12 +788,6 @@ CinnamenuPanel.prototype = {
bottom: 0,
right: 0
};
let viewModeBoxWrapperPadding = {
left: 0,
top: 0,
bottom: 0,
right: 0
};
if (this.viewModeBoxWrapper.get_stage()) {
let themeNode = this.viewModeBoxWrapper.get_theme_node();
viewModeBoxWrapperMargin = {
Expand All @@ -808,12 +802,6 @@ CinnamenuPanel.prototype = {
bottom: themeNode.get_border_width(St.Side.BOTTOM),
right: themeNode.get_border_width(St.Side.RIGHT),
};
viewModeBoxWrapperPadding = {
left: themeNode.get_padding(St.Side.LEFT),
top: themeNode.get_padding(St.Side.TOP),
bottom: themeNode.get_padding(St.Side.BOTTOM),
right: themeNode.get_padding(St.Side.RIGHT),
};
viewModeBoxWrapperWidth = this.viewModeBoxWrapper.width + viewModeBoxWrapperMargin.left +
viewModeBoxWrapperMargin.right + viewModeBoxWrapperBorder.left + viewModeBoxWrapperBorder.right;
}
Expand Down Expand Up @@ -2015,7 +2003,7 @@ CinnamenuPanel.prototype = {
},

destroyContainer: function(container) {
if (!container && container === undefined) {
if (!container) {
return false;
}
let children = container.get_children();
Expand All @@ -2031,26 +2019,31 @@ CinnamenuPanel.prototype = {
global.settings.disconnect(this.panelEditId);
this.destroyAppButtons();
this.destroyDisplayed();
PanelMenu.Button.prototype.destroy.call(this)
this._searchWebBookmarks.destroy();
},

destroyDisplayed: function() {
this.destroyContainer(this.searchBox);
this.destroyContainer(this.viewModeBox);
this.destroyContainer(this.viewModeWrapper);
this.destroyContainer(this.categoriesBox);
this.destroyContainer(this.powerGroupBox);
this.destroyContainer(this.viewModeBox);
this.destroyContainer(this.applicationsGridBox);
this.destroyContainer(this.applicationsListBox);
this.destroyContainer(this.applicationsBoxWrapper);
this.destroyContainer(this.applicationsScrollBox);
this.destroyContainer(this.topPane);
this.destroyContainer(this.groupCategoriesWorkspacesScrollBox);
this.destroyContainer(this.middlePane);
this.destroyContainer(this.bottomPane);
this.destroyContainer(this.mainBox);
let containers = [
'searchBox',
'viewModeBox',
'categoriesBox',
'powerGroupBox',
'applicationsGridBox',
'applicationsListBox',
'applicationsBoxWrapper',
'applicationsScrollBox',
'topPane',
'groupCategoriesWorkspacesScrollBox',
'middlePane',
'bottomPane',
'mainbox'
];

for (let i = 0, len = containers.length; i < len; i++) {
if (typeof this[containers[i]] !== 'undefined') {
this.destroyContainer(this[containers[i]]);
}
}
},

destroyAppButtons: function() {
Expand All @@ -2063,4 +2056,5 @@ CinnamenuPanel.prototype = {
this.appButtons = [];
},
};

Signals.addSignalMethods(CinnamenuPanel.prototype)
15 changes: 7 additions & 8 deletions Cinnamenu@json/files/Cinnamenu@json/3.4/applet.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* ========================================================================================================
* applet.js - Cinnamenu extension
* --------------------------------------------------------------------------------------------------------
* CREDITS:
* CREDITS:
* Forked from Gnomenu by The Panacea Projects - https://github.com/The-Panacea-Projects/Gnomenu.
* Ported to Cinnamon by Jason Hicks.
* A large part of this code was copied from the Mint menu and Axe menu extensions. Many thanks
Expand Down Expand Up @@ -150,13 +150,13 @@ CinnamenuButton.prototype = {
if (this.menuIcon === '') {
this.set_applet_icon_name('');
} else if (GLib.path_is_absolute(this.menuIcon) && GLib.file_test(this.menuIcon, GLib.FileTest.EXISTS)) {
if (this.menuIcon.search('-symbolic') != -1) {
if (this.menuIcon.search('-symbolic') !== -1) {
this.set_applet_icon_symbolic_path(this.menuIcon);
} else {
this.set_applet_icon_path(this.menuIcon);
}
} else if (Gtk.IconTheme.get_default().has_icon(this.menuIcon)) {
if (this.menuIcon.search('-symbolic') != -1) {
if (this.menuIcon.search('-symbolic') !== -1) {
this.set_applet_icon_symbolic_name(this.menuIcon);
} else {
this.set_applet_icon_name(this.menuIcon);
Expand All @@ -175,13 +175,12 @@ CinnamenuButton.prototype = {
this._applet_icon_box.show();
}

if (this.orientation == St.Side.LEFT || this.orientation == St.Side.RIGHT) // no menu label if in a vertical panel
{
if (this.orientation === St.Side.LEFT || this.orientation === St.Side.RIGHT) {
this.set_applet_label('');
} else {
if (this.panelMenuLabelText && this.panelMenuLabelText !== '') {
this.set_applet_label(_(this.menuLabel)); // TBD
this.set_applet_tooltip(_(this.menuLabel));
if (!this.panelMenuLabelText || this.panelMenuLabelText.length > 0) {
this.set_applet_label(this.menuLabel); // TBD
this.set_applet_tooltip(this.menuLabel);
} else {
this.set_applet_label('');
}
Expand Down
2 changes: 1 addition & 1 deletion Cinnamenu@json/files/Cinnamenu@json/3.4/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ AppListGridButton.prototype = {
}
}
}
this.toggleMenu(this._parent._applet.startupViewMod === ApplicationsViewMode.LIST);
this.toggleMenu(this._parent._applet.startupViewMode === ApplicationsViewMode.LIST);
},

setColumn: function(column) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 25 additions & 31 deletions Cinnamenu@json/files/Cinnamenu@json/3.4/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,11 @@ CinnamenuPanel.prototype = {
_listApplications: function(category_menu_id, pattern) {
let appList = [];

if (category_menu_id == 'all') {
if (category_menu_id === 'all') {
for (let directory in this.applicationsByCategory) {
appList = appList.concat(this.applicationsByCategory[directory]);
}
} else if (category_menu_id == 'favorites') {
} else if (category_menu_id === 'favorites') {
appList = this.favorites;
} else {
if (category_menu_id) {
Expand Down Expand Up @@ -788,12 +788,6 @@ CinnamenuPanel.prototype = {
bottom: 0,
right: 0
};
let viewModeBoxWrapperPadding = {
left: 0,
top: 0,
bottom: 0,
right: 0
};
if (this.viewModeBoxWrapper.get_stage()) {
let themeNode = this.viewModeBoxWrapper.get_theme_node();
viewModeBoxWrapperMargin = {
Expand All @@ -808,12 +802,6 @@ CinnamenuPanel.prototype = {
bottom: themeNode.get_border_width(St.Side.BOTTOM),
right: themeNode.get_border_width(St.Side.RIGHT),
};
viewModeBoxWrapperPadding = {
left: themeNode.get_padding(St.Side.LEFT),
top: themeNode.get_padding(St.Side.TOP),
bottom: themeNode.get_padding(St.Side.BOTTOM),
right: themeNode.get_padding(St.Side.RIGHT),
};
viewModeBoxWrapperWidth = this.viewModeBoxWrapper.width + viewModeBoxWrapperMargin.left +
viewModeBoxWrapperMargin.right + viewModeBoxWrapperBorder.left + viewModeBoxWrapperBorder.right;
}
Expand Down Expand Up @@ -2015,7 +2003,7 @@ CinnamenuPanel.prototype = {
},

destroyContainer: function(container) {
if (!container && container === undefined) {
if (!container) {
return false;
}
let children = container.get_children();
Expand All @@ -2031,26 +2019,31 @@ CinnamenuPanel.prototype = {
global.settings.disconnect(this.panelEditId);
this.destroyAppButtons();
this.destroyDisplayed();
PanelMenu.Button.prototype.destroy.call(this)
this._searchWebBookmarks.destroy();
},

destroyDisplayed: function() {
this.destroyContainer(this.searchBox);
this.destroyContainer(this.viewModeBox);
this.destroyContainer(this.viewModeWrapper);
this.destroyContainer(this.categoriesBox);
this.destroyContainer(this.powerGroupBox);
this.destroyContainer(this.viewModeBox);
this.destroyContainer(this.applicationsGridBox);
this.destroyContainer(this.applicationsListBox);
this.destroyContainer(this.applicationsBoxWrapper);
this.destroyContainer(this.applicationsScrollBox);
this.destroyContainer(this.topPane);
this.destroyContainer(this.groupCategoriesWorkspacesScrollBox);
this.destroyContainer(this.middlePane);
this.destroyContainer(this.bottomPane);
this.destroyContainer(this.mainBox);
let containers = [
'searchBox',
'viewModeBox',
'categoriesBox',
'powerGroupBox',
'applicationsGridBox',
'applicationsListBox',
'applicationsBoxWrapper',
'applicationsScrollBox',
'topPane',
'groupCategoriesWorkspacesScrollBox',
'middlePane',
'bottomPane',
'mainbox'
];

for (let i = 0, len = containers.length; i < len; i++) {
if (typeof this[containers[i]] !== 'undefined') {
this.destroyContainer(this[containers[i]]);
}
}
},

destroyAppButtons: function() {
Expand All @@ -2063,4 +2056,5 @@ CinnamenuPanel.prototype = {
this.appButtons = [];
},
};

Signals.addSignalMethods(CinnamenuPanel.prototype)
2 changes: 1 addition & 1 deletion Cinnamenu@json/files/Cinnamenu@json/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Cinnamenu",
"description": "A flexible menu providing formatting options and bookmarks.",
"max-instances": -1,
"version": "1.2.1",
"version": "1.2.2",
"multiversion": true,
"cinnamon-version": ["3.2", "3.4"]
}
Loading

0 comments on commit 6e978fd

Please sign in to comment.