mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:58:11 +00:00
LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
This commit is contained in:
parent
939a605334
commit
11580babbf
269 changed files with 1513 additions and 1315 deletions
|
@ -87,7 +87,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
|||
}
|
||||
};
|
||||
|
||||
set_icon(GraphicsBitmap::load_from_file("/res/icons/16x16/properties.png"));
|
||||
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/properties.png"));
|
||||
make_divider(general_tab);
|
||||
|
||||
struct stat st;
|
||||
|
@ -154,7 +154,7 @@ PropertiesDialog::~PropertiesDialog() {}
|
|||
|
||||
void PropertiesDialog::update()
|
||||
{
|
||||
m_icon->set_icon(const_cast<GraphicsBitmap*>(m_model.icon_for_file(m_mode, m_name).bitmap_for_size(32)));
|
||||
m_icon->set_icon(const_cast<Gfx::Bitmap*>(m_model.icon_for_file(m_mode, m_name).bitmap_for_size(32)));
|
||||
set_title(String::format("Properties of \"%s\"", m_name.characters()));
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ void PropertiesDialog::make_permission_checkboxes(NonnullRefPtr<GUI::Widget>& pa
|
|||
widget->layout()->set_spacing(10);
|
||||
|
||||
auto label = GUI::Label::construct(label_string, widget);
|
||||
label->set_text_alignment(TextAlignment::CenterLeft);
|
||||
label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto box_read = GUI::CheckBox::construct("Read", widget);
|
||||
box_read->set_checked(mode & masks.read);
|
||||
|
@ -248,10 +248,10 @@ void PropertiesDialog::make_property_value_pairs(const Vector<PropertyValuePair>
|
|||
label_container->layout()->set_spacing(12);
|
||||
|
||||
auto label_property = GUI::Label::construct(pair.property, label_container);
|
||||
label_property->set_text_alignment(TextAlignment::CenterLeft);
|
||||
label_property->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
label_property->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
|
||||
GUI::Label::construct(pair.value, label_container)->set_text_alignment(TextAlignment::CenterLeft);
|
||||
GUI::Label::construct(pair.value, label_container)->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
max_width = max(max_width, label_property->font().width(pair.property));
|
||||
property_labels.append(label_property);
|
||||
|
@ -276,8 +276,8 @@ void PropertiesDialog::make_divider(NonnullRefPtr<GUI::Widget>& parent)
|
|||
auto divider = GUI::Frame::construct(parent.ptr());
|
||||
divider->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||
divider->set_preferred_size({ 0, 2 });
|
||||
divider->set_frame_shape(FrameShape::HorizontalLine);
|
||||
divider->set_frame_shadow(FrameShadow::Sunken);
|
||||
divider->set_frame_shape(Gfx::FrameShape::HorizontalLine);
|
||||
divider->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
divider->set_frame_thickness(2);
|
||||
|
||||
parent->layout()->add_spacer();
|
||||
|
|
|
@ -126,8 +126,8 @@ int main(int argc, char** argv)
|
|||
progressbar->set_caption("Generating thumbnails: ");
|
||||
progressbar->set_format(GUI::ProgressBar::Format::ValueSlashMax);
|
||||
progressbar->set_visible(false);
|
||||
progressbar->set_frame_shape(FrameShape::Panel);
|
||||
progressbar->set_frame_shadow(FrameShadow::Sunken);
|
||||
progressbar->set_frame_shape(Gfx::FrameShape::Panel);
|
||||
progressbar->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
progressbar->set_frame_thickness(1);
|
||||
|
||||
location_textbox->on_return_pressed = [&] {
|
||||
|
@ -164,11 +164,11 @@ int main(int argc, char** argv)
|
|||
auto tree_view_directory_context_menu = GUI::Menu::construct("Tree View Directory");
|
||||
auto tree_view_context_menu = GUI::Menu::construct("Tree View");
|
||||
|
||||
auto open_parent_directory_action = GUI::Action::create("Open parent directory", { Mod_Alt, Key_Up }, GraphicsBitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"), [&](const GUI::Action&) {
|
||||
auto open_parent_directory_action = GUI::Action::create("Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"), [&](const GUI::Action&) {
|
||||
directory_view->open_parent_directory();
|
||||
});
|
||||
|
||||
auto mkdir_action = GUI::Action::create("New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, GraphicsBitmap::load_from_file("/res/icons/16x16/mkdir.png"), [&](const GUI::Action&) {
|
||||
auto mkdir_action = GUI::Action::create("New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/mkdir.png"), [&](const GUI::Action&) {
|
||||
auto input_box = GUI::InputBox::construct("Enter name:", "New directory", window);
|
||||
if (input_box->exec() == GUI::InputBox::ExecOK && !input_box->text_value().is_empty()) {
|
||||
auto new_dir_path = canonicalized_path(
|
||||
|
@ -188,7 +188,7 @@ int main(int argc, char** argv)
|
|||
RefPtr<GUI::Action> view_as_icons_action;
|
||||
RefPtr<GUI::Action> view_as_columns_action;
|
||||
|
||||
view_as_table_action = GUI::Action::create("Table view", { Mod_Ctrl, KeyCode::Key_L }, GraphicsBitmap::load_from_file("/res/icons/16x16/table-view.png"), [&](const GUI::Action&) {
|
||||
view_as_table_action = GUI::Action::create("Table view", { Mod_Ctrl, KeyCode::Key_L }, Gfx::Bitmap::load_from_file("/res/icons/16x16/table-view.png"), [&](const GUI::Action&) {
|
||||
directory_view->set_view_mode(DirectoryView::ViewMode::List);
|
||||
view_as_table_action->set_checked(true);
|
||||
|
||||
|
@ -197,7 +197,7 @@ int main(int argc, char** argv)
|
|||
}, window);
|
||||
view_as_table_action->set_checkable(true);
|
||||
|
||||
view_as_icons_action = GUI::Action::create("Icon view", { Mod_Ctrl, KeyCode::Key_I }, GraphicsBitmap::load_from_file("/res/icons/16x16/icon-view.png"), [&](const GUI::Action&) {
|
||||
view_as_icons_action = GUI::Action::create("Icon view", { Mod_Ctrl, KeyCode::Key_I }, Gfx::Bitmap::load_from_file("/res/icons/16x16/icon-view.png"), [&](const GUI::Action&) {
|
||||
directory_view->set_view_mode(DirectoryView::ViewMode::Icon);
|
||||
view_as_icons_action->set_checked(true);
|
||||
|
||||
|
@ -206,7 +206,7 @@ int main(int argc, char** argv)
|
|||
}, window);
|
||||
view_as_icons_action->set_checkable(true);
|
||||
|
||||
view_as_columns_action = GUI::Action::create("Columns view", GraphicsBitmap::load_from_file("/res/icons/16x16/columns-view.png"), [&](const GUI::Action&) {
|
||||
view_as_columns_action = GUI::Action::create("Columns view", Gfx::Bitmap::load_from_file("/res/icons/16x16/columns-view.png"), [&](const GUI::Action&) {
|
||||
directory_view->set_view_mode(DirectoryView::ViewMode::Columns);
|
||||
view_as_columns_action->set_checked(true);
|
||||
|
||||
|
@ -298,7 +298,7 @@ int main(int argc, char** argv)
|
|||
};
|
||||
|
||||
auto properties_action
|
||||
= GUI::Action::create("Properties...", { Mod_Alt, Key_Return }, GraphicsBitmap::load_from_file("/res/icons/16x16/properties.png"), [&](const GUI::Action& action) {
|
||||
= GUI::Action::create("Properties...", { Mod_Alt, Key_Return }, Gfx::Bitmap::load_from_file("/res/icons/16x16/properties.png"), [&](const GUI::Action& action) {
|
||||
auto& model = directory_view->model();
|
||||
String path;
|
||||
Vector<String> selected;
|
||||
|
@ -445,7 +445,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto help_menu = GUI::Menu::construct("Help");
|
||||
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
|
||||
GUI::AboutDialog::show("File Manager", load_png("/res/icons/32x32/filetype-folder.png"), window);
|
||||
GUI::AboutDialog::show("File Manager", Gfx::load_png("/res/icons/32x32/filetype-folder.png"), window);
|
||||
}));
|
||||
menubar->add_menu(move(help_menu));
|
||||
|
||||
|
@ -502,7 +502,7 @@ int main(int argc, char** argv)
|
|||
delete_action->set_enabled(!view.selection().is_empty());
|
||||
};
|
||||
|
||||
auto open_in_text_editor_action = GUI::Action::create("Open in TextEditor...", GraphicsBitmap::load_from_file("/res/icons/TextEditor16.png"), [&](auto&) {
|
||||
auto open_in_text_editor_action = GUI::Action::create("Open in TextEditor...", Gfx::Bitmap::load_from_file("/res/icons/TextEditor16.png"), [&](auto&) {
|
||||
for (auto& path : selected_file_paths()) {
|
||||
if (!fork()) {
|
||||
int rc = execl("/bin/TextEditor", "TextEditor", path.characters(), nullptr);
|
||||
|
@ -587,7 +587,7 @@ int main(int argc, char** argv)
|
|||
window->set_main_widget(widget);
|
||||
window->show();
|
||||
|
||||
window->set_icon(load_png("/res/icons/16x16/filetype-folder.png"));
|
||||
window->set_icon(Gfx::load_png("/res/icons/16x16/filetype-folder.png"));
|
||||
|
||||
// Read direcory read mode from config.
|
||||
auto dir_view_mode = config->read_entry("DirectoryView", "ViewMode", "Icon");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue