Skip to content

Commit

Permalink
Merge pull request #352 from CorbinWunderlich/start-menu-change-direc…
Browse files Browse the repository at this point in the history
…tion

Make the float menu list and window list open up or down depending on position
  • Loading branch information
totaam authored Jan 14, 2025
2 parents 4343ad0 + 1685792 commit 44bc77e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions html5/js/MenuCustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,33 @@ $(function () {
client.mouse_grabbed = false;
client.toolbar_position = "custom";
client.reconfigure_all_trays();

if (float_menu.children(".Menu").hasClass("-vertical")) {
return;
}

// If the float menu is in the upper half of the screen, the menu_list and open_windows_list will open downwards, and vice versa.
const float_menu_top_css = float_menu.css("top")
const float_menu_top = float_menu_top_css.substring(0, float_menu_top_css.length - 2);

if (Number(float_menu_top) > client.desktop_height / 2) {
$("#menu_list").css("bottom", "30px");
$("#open_windows_list").css({
"bottom": "30px",
"border-top-left-radius": "3px",
"border-top-right-radius": "3px",
"border-bottom-left-radius": "0px",
"border-bottom-right-radius": "0px"
});
} else {
$("#menu_list").css("bottom", "unset");
$("#open_windows_list").css({
"bottom": "unset",
"border-top-left-radius": "0px",
"border-top-right-radius": "0px",
"border-bottom-left-radius": "3px",
"border-bottom-right-radius": "3px"
});
}
});
});

0 comments on commit 44bc77e

Please sign in to comment.