diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-11 14:27:31 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-11 14:27:31 +0200 |
commit | 93b76628a532225f725a0a653415f43e5a1d72e7 (patch) | |
tree | 5b6c73ec667f87d6eaeedb6256495a71971e4727 | |
parent | f0501a0102efa3abbaefca06031443620215642e (diff) | |
download | serenity-93b76628a532225f725a0a653415f43e5a1d72e7.zip |
GGroupBox: Improve appearance with new FrameShape::Box style.
-rw-r--r-- | Applications/VisualBuilder/VBForm.cpp | 8 | ||||
-rw-r--r-- | Kernel/init.cpp | 9 | ||||
-rw-r--r-- | LibGUI/GGroupBox.cpp | 2 | ||||
-rw-r--r-- | SharedGraphics/StylePainter.cpp | 9 | ||||
-rw-r--r-- | SharedGraphics/StylePainter.h | 2 |
5 files changed, 25 insertions, 5 deletions
diff --git a/Applications/VisualBuilder/VBForm.cpp b/Applications/VisualBuilder/VBForm.cpp index 464a56c1a9..d29b83d201 100644 --- a/Applications/VisualBuilder/VBForm.cpp +++ b/Applications/VisualBuilder/VBForm.cpp @@ -18,7 +18,7 @@ VBForm::VBForm(const String& name, GWidget* parent) set_greedy_for_hits(true); auto box1 = VBWidget::create(WidgetType::GSpinBox, *this); - box1->set_rect({ 10, 10, 81, 25 }); + box1->set_rect({ 10, 10, 81, 21 }); m_widgets.append(move(box1)); auto box2 = VBWidget::create(WidgetType::GTextEditor, *this); @@ -26,8 +26,12 @@ VBForm::VBForm(const String& name, GWidget* parent) m_widgets.append(move(box2)); auto button1 = VBWidget::create(WidgetType::GButton, *this); - button1->set_rect({ 200, 50, 81, 25 }); + button1->set_rect({ 200, 50, 81, 21 }); m_widgets.append(move(button1)); + + auto groupbox1 = VBWidget::create(WidgetType::GGroupBox, *this); + groupbox1->set_rect({ 300, 150, 161, 51 }); + m_widgets.append(move(groupbox1)); } void VBForm::insert_widget(WidgetType type) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 965c6efe0f..4989d2331a 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -26,12 +26,14 @@ #include <Kernel/Net/E1000NetworkAdapter.h> #include <Kernel/Net/NetworkTask.h> -#define SPAWN_LAUNCHER +//#define SPAWN_TERMINAL +//#define SPAWN_LAUNCHER //#define SPAWN_GUITEST2 //#define SPAWN_FILE_MANAGER //#define SPAWN_PROCESS_MANAGER //#define SPAWN_TEXT_EDITOR //#define SPAWN_FONTEDITOR +#define SPAWN_VISUAL_BUILDER //#define SPAWN_MULTIPLE_SHELLS //#define STRESS_TEST_SPAWNING @@ -101,13 +103,18 @@ VFS* vfs; window_server_process->set_priority(Process::HighPriority); Process::create_user_process("/bin/Taskbar", (uid_t)100, (gid_t)100, (pid_t)0, error); //Process::create_user_process("/bin/sh", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, move(environment), tty0); +#ifdef SPAWN_TERMINAL Process::create_user_process("/bin/Terminal", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); +#endif #ifdef SPAWN_GUITEST2 Process::create_user_process("/bin/guitest2", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); #endif #ifdef SPAWN_LAUNCHER Process::create_user_process("/bin/Launcher", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); #endif +#ifdef SPAWN_VISUAL_BUILDER + Process::create_user_process("/bin/VisualBuilder", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); +#endif #ifdef SPAWN_FILE_MANAGER Process::create_user_process("/bin/FileManager", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0); #endif diff --git a/LibGUI/GGroupBox.cpp b/LibGUI/GGroupBox.cpp index 5aba8b5e87..146f4a4dcc 100644 --- a/LibGUI/GGroupBox.cpp +++ b/LibGUI/GGroupBox.cpp @@ -23,7 +23,7 @@ void GGroupBox::paint_event(GPaintEvent& event) 0, font().glyph_height() / 2, width(), height() - font().glyph_height() / 2 }; - StylePainter::paint_frame(painter, frame_rect, FrameShape::Panel, FrameShadow::Sunken, 1); + StylePainter::paint_frame(painter, frame_rect, FrameShape::Box, FrameShadow::Sunken, 2); Rect text_rect { 4, 0, font().width(m_name) + 6, font().glyph_height() }; painter.fill_rect(text_rect, background_color()); diff --git a/SharedGraphics/StylePainter.cpp b/SharedGraphics/StylePainter.cpp index a7970d1d32..b87837ee99 100644 --- a/SharedGraphics/StylePainter.cpp +++ b/SharedGraphics/StylePainter.cpp @@ -153,4 +153,13 @@ void StylePainter::paint_frame(Painter& painter, const Rect& rect, FrameShape sh painter.draw_line(inner_container_frame_rect.top_left().translated(0, 1), inner_container_frame_rect.bottom_left().translated(0, -1), top_left_color); painter.draw_line(inner_container_frame_rect.top_right(), inner_container_frame_rect.bottom_right().translated(0, -1), bottom_right_color); } + + if (shape == FrameShape::Box && thickness >= 2) { + swap(top_left_color, bottom_right_color); + Rect inner_rect = rect.shrunken(2, 2); + painter.draw_line(inner_rect.top_left(), inner_rect.top_right(), top_left_color); + painter.draw_line(inner_rect.bottom_left(), inner_rect.bottom_right(), bottom_right_color); + painter.draw_line(inner_rect.top_left().translated(0, 1), inner_rect.bottom_left().translated(0, -1), top_left_color); + painter.draw_line(inner_rect.top_right(), inner_rect.bottom_right().translated(0, -1), bottom_right_color); + } } diff --git a/SharedGraphics/StylePainter.h b/SharedGraphics/StylePainter.h index 264b7ba60c..023191b077 100644 --- a/SharedGraphics/StylePainter.h +++ b/SharedGraphics/StylePainter.h @@ -5,7 +5,7 @@ class Rect; enum class ButtonStyle { Normal, CoolBar, OldNormal }; enum class FrameShadow { Plain, Raised, Sunken }; -enum class FrameShape { NoFrame, Container, Panel, VerticalLine, HorizontalLine }; +enum class FrameShape { NoFrame, Box, Container, Panel, VerticalLine, HorizontalLine }; class StylePainter { public: |