mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
7dc5a3ead8
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. :^)
89 lines
1.9 KiB
Text
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"
|
|
}
|
|
}
|
|
|