mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 23:28:12 +08:00
Minor Tooling and UI Improvements (#1314)
* [wip]fix: disable fill and gradient tools on bmp images - aims to fix #1161 * [wip]fix: disable gradient tool for bmp images * fix: disable gradient tool for bitmap images - fixes https://github.com/GraphiteEditor/Graphite/issues/1161 * [wip]fix: disable menu bar elements if no open document * [WIP]feat: render certain menubar elements if document is open * fix: conditional menu bar rendering fixes - update menu bar on certain document actions - fix menu bar order on rendering all elements * refactor: change conditional menu elements property - use existing 'disabled' property * feat: render menu dropdown items conditionally * fix: revert formatter whitespace changes * refactor: improve variable naming and message usage - name menu bar bool flag better - use SendLayout message and remove unneeded calls
This commit is contained in:
@@ -37,12 +37,14 @@ pub struct MenuBarEntry {
|
||||
pub shortcut: Option<ActionKeys>,
|
||||
pub action: WidgetHolder,
|
||||
pub children: MenuBarEntryChildren,
|
||||
pub disabled: bool,
|
||||
}
|
||||
|
||||
impl MenuBarEntry {
|
||||
pub fn new_root(label: String, children: MenuBarEntryChildren) -> Self {
|
||||
pub fn new_root(label: String, disabled: bool, children: MenuBarEntryChildren) -> Self {
|
||||
Self {
|
||||
label,
|
||||
disabled,
|
||||
children,
|
||||
..Default::default()
|
||||
}
|
||||
@@ -67,6 +69,7 @@ impl Default for MenuBarEntry {
|
||||
shortcut: None,
|
||||
action: MenuBarEntry::no_action(),
|
||||
children: MenuBarEntryChildren::empty(),
|
||||
disabled: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user