serenity/Applications/TextEditor/TextEditorWindow.gml
Andreas Kling 7dc5a3ead8 LibGUI: Rewrite layout system in terms of min and max sizes
This patch removes size policies and preferred sizes, and replaces them
with min-size and max-size for each widget.

Box layout now works in 3 passes:

    1) Set all items (widgets/spacers) to their min-size
    2) Distribute remaining space evenly, respecting max-size
    3) Place widgets one after the other, adding spacing in between

I've also added convenience helpers for setting a fixed size (which is
the same as setting min-size and max-size to the same value.)

This significantly reduces the verbosity of widget layout and makes GML
a bit more pleasant to write, too. :^)
2020-12-30 01:36:41 +01:00

89 lines
1.9 KiB
Text

@GUI::Widget {
name: "main"
fill_with_background_color: true
layout: @GUI::VerticalBoxLayout {
spacing: 2
}
@GUI::ToolBarContainer {
@GUI::ToolBar {
name: "toolbar"
}
}
@GUI::HorizontalSplitter {
@GUI::TextEditor {
name: "editor"
}
@Web::OutOfProcessWebView {
name: "webview"
visible: false
}
}
@GUI::Widget {
name: "find_replace_widget"
visible: false
fill_with_background_color: true
fixed_height: 48
layout: @GUI::VerticalBoxLayout {
margins: [2, 2, 2, 4]
}
@GUI::Widget {
name: "find_widget"
fill_with_background_color: true
fixed_height: 22
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Button {
name: "find_previous_button"
text: "Find previous"
fixed_width: 150
}
@GUI::Button {
name: "find_next_button"
text: "Find next"
fixed_width: 150
}
}
@GUI::Widget {
name: "replace_widget"
fill_with_background_color: true
fixed_height: 22
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Button {
name: "replace_previous_button"
text: "Replace previous"
fixed_width: 100
}
@GUI::Button {
name: "replace_next_button"
text: "Replace next"
fixed_width: 100
}
@GUI::Button {
name: "replace_all_button"
text: "Replace all"
fixed_width: 100
}
}
}
@GUI::StatusBar {
name: "statusbar"
}
}