Skip to content

Commit

Permalink
Merge pull request linuxmint#9333 from fredcw/patch-1
Browse files Browse the repository at this point in the history
[email protected]: a fix for jumpiness bug
  • Loading branch information
mtwebster authored Jun 12, 2020
2 parents 7d70ccd + 02f7c9a commit af9d3da
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions files/usr/share/cinnamon/applets/[email protected]/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,12 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {

this.lastSelectedCategory = null;

/* This is a workaround to prevent selectedAppBox from changing height when no height value is set
* in the .css style and thus causing the menu above to jump up and down. This has no effect when a
* height value is set in the .css style as get_preferred_height() returns this value in this case*/
this.selectedAppBox.set_height(-1); //unset previously set height
this.selectedAppBox.set_height(this.selectedAppBox.get_preferred_height(-1)[1]);

let n = Math.min(this._applicationsButtons.length,
INITIAL_BUTTON_LOAD);
for (let i = 0; i < n; i++) {
Expand Down Expand Up @@ -2471,11 +2477,6 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {
this.mainBox._delegate = null;

this.selectedAppBox = new St.BoxLayout({ style_class: 'menu-selected-app-box', vertical: true });

if (this.selectedAppBox.peek_theme_node() == null ||
this.selectedAppBox.get_theme_node().get_length('height') == 0)
this.selectedAppBox.set_height(30 * global.ui_scale);

this.selectedAppTitle = new St.Label({ style_class: 'menu-selected-app-title', text: "" });
this.selectedAppBox.add_actor(this.selectedAppTitle);
this.selectedAppDescription = new St.Label({ style_class: 'menu-selected-app-description', text: "" });
Expand Down

0 comments on commit af9d3da

Please sign in to comment.