Skip to content

Commit

Permalink
Make menu bars wrap to multiple rows
Browse files Browse the repository at this point in the history
  • Loading branch information
1j01 committed Nov 21, 2021
1 parent 70000c0 commit 4326860
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build/layout.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/layout.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions demo/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ const menus = {
},
},
],
"&Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong Menu Button Text": [
],
"&Help": new Array(100).fill(0).map((_, i) => ({
item: new Array(i + 3).fill("A").join(""),
})),
Expand All @@ -215,6 +217,8 @@ $main_test_window = new $Window({
title: "Test Station",
resizable: false,
icons: { 16: "https://win98icons.alexmeub.com/icons/png/application_hammer_grouppol-0.png" },
innerWidth: 300,
// innerHeight: 600,
});
$main_test_window.setMenuBar(new MenuBar(menus));
$main_test_window.$content.append(`
Expand Down
5 changes: 5 additions & 0 deletions src/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ body > .window-titlebar {
.menus {
display: flex;
flex: 0 0 auto;
flex-wrap: wrap;
}
.menu-popup {
position: absolute;
Expand All @@ -65,8 +66,12 @@ body > .window-titlebar {
.menu-popup-table {
border-collapse: collapse;
}
.menu-button,
.menu-item {
white-space: nowrap;
max-width: 100%;
overflow: hidden;
/* text-overflow: ellipsis; might imply a dialog */
}
.menu-hr {
display: block !important;
Expand Down

0 comments on commit 4326860

Please sign in to comment.