Skip to content

Commit

Permalink
better menu separators
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Mar 30, 2024
1 parent 7a970a7 commit 605dd2b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
10 changes: 10 additions & 0 deletions haxe/ui/_module/styles/default/menus.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
}

.menuseparator {
width: 100%;
height: auto;
}

.menuseparator-line {
height: 1px;
width: 100%;
background-color: $normal-border-color;
Expand All @@ -158,3 +163,8 @@
.menu.rounded .menuitem {
border-radius: 3px;
}

.menu.rounded .menuseparator {
padding-top: 3px;
padding-bottom: 3px;
}
23 changes: 22 additions & 1 deletion haxe/ui/containers/menus/MenuSeparator.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
package haxe.ui.containers.menus;

import haxe.ui.core.Component;
import haxe.ui.core.CompositeBuilder;
import haxe.ui.layouts.DefaultLayout;

@:composite(Builder, Layout)
class MenuSeparator extends Component {
}
}

//***********************************************************************************************************
// Composite Builder
//***********************************************************************************************************
@:dox(hide) @:noCompletion
@:access(haxe.ui.core.Component)
private class Builder extends CompositeBuilder {
public override function create() {
super.create();
var line = new Component();
line.scriptAccess = false;
line.addClass("menuseparator-line");
_component.addComponent(line);
}
}

private class Layout extends DefaultLayout {
}

0 comments on commit 605dd2b

Please sign in to comment.