1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:27:45 +00:00

LibGUI: Add shortcuts to common locations in GUI::FilePicker

This patch adds a handy set of buttons on the left hand side that can
take you to common locations such as:

- Your home directory
- Your desktop directory
- The root directory
This commit is contained in:
Andreas Kling 2021-04-06 19:23:04 +02:00
parent 346e0f4dac
commit 25de655d43
2 changed files with 86 additions and 36 deletions

View file

@ -1,73 +1,106 @@
@GUI::Widget {
fill_with_background_color: true
layout: @GUI::VerticalBoxLayout {
layout: @GUI::HorizontalBoxLayout {
margins: [4, 4, 4, 4]
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::HorizontalBoxLayout {
layout: @GUI::VerticalBoxLayout {
margins: [4, 4, 4, 4]
}
@GUI::TextBox {
name: "location_textbox"
@GUI::Label {
text: "Look in:"
text_alignment: "CenterRight"
fixed_height: 24
}
@GUI::ToolBar {
name: "toolbar"
}
}
@GUI::Frame {
name: "common_locations_frame"
fixed_width: 80
fill_with_background_color: true
@GUI::MultiView {
name: "view"
layout: @GUI::VerticalBoxLayout {
margins: [2, 4, 2, 4]
spacing: 0
}
}
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::VerticalBoxLayout {
margins: [4, 4, 4, 4]
}
@GUI::Widget {
fixed_height: 24
layout: @GUI::HorizontalBoxLayout {
}
shrink_to_fit: true
@GUI::Label {
text: "File name:"
text_alignment: "CenterLeft"
fixed_width:80
layout: @GUI::HorizontalBoxLayout {
}
@GUI::TextBox {
name: "filename_textbox"
name: "location_textbox"
}
@GUI::Widget {
fixed_width: 20
}
@GUI::Button {
name: "ok_button"
text: "OK"
fixed_width: 75
@GUI::ToolBar {
name: "toolbar"
}
}
@GUI::Widget {
fixed_height: 24
layout: @GUI::HorizontalBoxLayout {
@GUI::MultiView {
name: "view"
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::VerticalBoxLayout {
}
@GUI::Widget {
fixed_height: 24
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Label {
text: "File name:"
text_alignment: "CenterLeft"
fixed_width: 80
}
@GUI::TextBox {
name: "filename_textbox"
}
@GUI::Widget {
fixed_width: 20
}
@GUI::Button {
name: "ok_button"
text: "OK"
fixed_width: 75
}
}
@GUI::Button {
name: "cancel_button"
text: "Cancel"
fixed_width: 75
@GUI::Widget {
fixed_height: 24
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Widget {
}
@GUI::Button {
name: "cancel_button"
text: "Cancel"
fixed_width: 75
}
}
}
}