mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +00:00
Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
This commit is contained in:
parent
86bdfa1edf
commit
a2baab38fd
141 changed files with 518 additions and 518 deletions
|
@ -33,7 +33,7 @@
|
|||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/ModelEditingDelegate.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Menubar.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
|
|
|
@ -25,13 +25,13 @@
|
|||
*/
|
||||
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/BreadcrumbBar.h>
|
||||
#include <LibGUI/Breadcrumbbar.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, BreadcrumbBar)
|
||||
REGISTER_WIDGET(GUI, Breadcrumbbar)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
@ -76,26 +76,26 @@ private:
|
|||
BreadcrumbButton() { }
|
||||
};
|
||||
|
||||
BreadcrumbBar::BreadcrumbBar()
|
||||
Breadcrumbbar::Breadcrumbbar()
|
||||
{
|
||||
auto& layout = set_layout<HorizontalBoxLayout>();
|
||||
layout.set_spacing(0);
|
||||
}
|
||||
|
||||
BreadcrumbBar::~BreadcrumbBar()
|
||||
Breadcrumbbar::~Breadcrumbbar()
|
||||
{
|
||||
}
|
||||
|
||||
void BreadcrumbBar::clear_segments()
|
||||
void Breadcrumbbar::clear_segments()
|
||||
{
|
||||
m_segments.clear();
|
||||
remove_all_children();
|
||||
}
|
||||
|
||||
void BreadcrumbBar::append_segment(String text, const Gfx::Bitmap* icon, String data, String tooltip)
|
||||
void Breadcrumbbar::append_segment(String text, const Gfx::Bitmap* icon, String data, String tooltip)
|
||||
{
|
||||
auto& button = add<BreadcrumbButton>();
|
||||
button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
button.set_button_style(Gfx::ButtonStyle::Coolbar);
|
||||
button.set_text(text);
|
||||
button.set_icon(icon);
|
||||
button.set_tooltip(move(tooltip));
|
||||
|
@ -125,7 +125,7 @@ void BreadcrumbBar::append_segment(String text, const Gfx::Bitmap* icon, String
|
|||
m_segments.append(move(segment));
|
||||
}
|
||||
|
||||
void BreadcrumbBar::set_selected_segment(Optional<size_t> index)
|
||||
void Breadcrumbbar::set_selected_segment(Optional<size_t> index)
|
||||
{
|
||||
if (!index.has_value()) {
|
||||
for_each_child_of_type<GUI::AbstractButton>([&](auto& button) {
|
||||
|
@ -140,7 +140,7 @@ void BreadcrumbBar::set_selected_segment(Optional<size_t> index)
|
|||
segment.button->set_checked(true);
|
||||
}
|
||||
|
||||
void BreadcrumbBar::doubleclick_event(MouseEvent& event)
|
||||
void Breadcrumbbar::doubleclick_event(MouseEvent& event)
|
||||
{
|
||||
if (on_doubleclick)
|
||||
on_doubleclick(event);
|
|
@ -30,11 +30,11 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class BreadcrumbBar : public GUI::Widget {
|
||||
C_OBJECT(BreadcrumbBar);
|
||||
class Breadcrumbbar : public GUI::Widget {
|
||||
C_OBJECT(Breadcrumbbar);
|
||||
|
||||
public:
|
||||
virtual ~BreadcrumbBar() override;
|
||||
virtual ~Breadcrumbbar() override;
|
||||
|
||||
void clear_segments();
|
||||
void append_segment(String text, const Gfx::Bitmap* icon = nullptr, String data = {}, String tooltip = {});
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
Function<void(MouseEvent& event)> on_doubleclick;
|
||||
|
||||
private:
|
||||
BreadcrumbBar();
|
||||
Breadcrumbbar();
|
||||
|
||||
struct Segment {
|
||||
RefPtr<const Gfx::Bitmap> icon;
|
|
@ -49,7 +49,7 @@ Button::Button(String text)
|
|||
REGISTER_ENUM_PROPERTY(
|
||||
"button_style", button_style, set_button_style, Gfx::ButtonStyle,
|
||||
{ Gfx::ButtonStyle::Normal, "Normal" },
|
||||
{ Gfx::ButtonStyle::CoolBar, "CoolBar" });
|
||||
{ Gfx::ButtonStyle::Coolbar, "Coolbar" });
|
||||
}
|
||||
|
||||
Button::~Button()
|
||||
|
@ -77,7 +77,7 @@ void Button::paint_event(PaintEvent& event)
|
|||
|
||||
if (paint_pressed || is_checked()) {
|
||||
painter.translate(1, 1);
|
||||
} else if (m_icon && is_enabled() && is_hovered() && button_style() == Gfx::ButtonStyle::CoolBar) {
|
||||
} else if (m_icon && is_enabled() && is_hovered() && button_style() == Gfx::ButtonStyle::Coolbar) {
|
||||
auto shadow_color = palette().button().darkened(0.7f);
|
||||
painter.blit_filtered(icon_location.translated(1, 1), *m_icon, m_icon->rect(), [&shadow_color](auto) {
|
||||
return shadow_color;
|
||||
|
|
|
@ -12,7 +12,7 @@ set(SOURCES
|
|||
Application.cpp
|
||||
AutocompleteProvider.cpp
|
||||
BoxLayout.cpp
|
||||
BreadcrumbBar.cpp
|
||||
Breadcrumbbar.cpp
|
||||
Button.cpp
|
||||
Calendar.cpp
|
||||
CheckBox.cpp
|
||||
|
@ -56,7 +56,7 @@ set(SOURCES
|
|||
LinkLabel.cpp
|
||||
ListView.cpp
|
||||
Menu.cpp
|
||||
MenuBar.cpp
|
||||
Menubar.cpp
|
||||
MenuItem.cpp
|
||||
MessageBox.cpp
|
||||
Model.cpp
|
||||
|
@ -67,12 +67,12 @@ set(SOURCES
|
|||
OpacitySlider.cpp
|
||||
Painter.cpp
|
||||
ProcessChooser.cpp
|
||||
ProgressBar.cpp
|
||||
Progressbar.cpp
|
||||
RadioButton.cpp
|
||||
RegularEditingEngine.cpp
|
||||
ResizeCorner.cpp
|
||||
RunningProcessesModel.cpp
|
||||
ScrollBar.cpp
|
||||
Scrollbar.cpp
|
||||
ScrollableWidget.cpp
|
||||
SeparatorWidget.cpp
|
||||
Shortcut.cpp
|
||||
|
@ -81,14 +81,14 @@ set(SOURCES
|
|||
SpinBox.cpp
|
||||
Splitter.cpp
|
||||
StackWidget.cpp
|
||||
StatusBar.cpp
|
||||
Statusbar.cpp
|
||||
TabWidget.cpp
|
||||
TableView.cpp
|
||||
TextBox.cpp
|
||||
TextDocument.cpp
|
||||
TextEditor.cpp
|
||||
ToolBar.cpp
|
||||
ToolBarContainer.cpp
|
||||
Toolbar.cpp
|
||||
ToolbarContainer.cpp
|
||||
TreeView.cpp
|
||||
UndoStack.cpp
|
||||
Variant.cpp
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <LibGUI/ColumnsView.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGfx/CharacterBitmap.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/ListView.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
|
|||
auto emoji_text = builder.to_string();
|
||||
auto& button = horizontal_container.add<Button>(emoji_text);
|
||||
button.set_min_size(16, 16);
|
||||
button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
button.set_button_style(Gfx::ButtonStyle::Coolbar);
|
||||
button.on_click = [this, button = &button](auto) {
|
||||
m_selected_emoji_text = button->text();
|
||||
done(ExecOK);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <LibGUI/MultiView.h>
|
||||
#include <LibGUI/SortingProxyModel.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
#include <LibGUI/ToolBar.h>
|
||||
#include <LibGUI/Toolbar.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <string.h>
|
||||
|
@ -104,7 +104,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& file_
|
|||
if (!widget.load_from_gml(file_picker_dialog_gml))
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
auto& toolbar = *widget.find_descendant_of_type_named<GUI::ToolBar>("toolbar");
|
||||
auto& toolbar = *widget.find_descendant_of_type_named<GUI::Toolbar>("toolbar");
|
||||
toolbar.set_has_frame(false);
|
||||
|
||||
m_location_textbox = *widget.find_descendant_of_type_named<GUI::TextBox>("location_textbox");
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
name: "location_textbox"
|
||||
}
|
||||
|
||||
@GUI::ToolBar {
|
||||
@GUI::Toolbar {
|
||||
name: "toolbar"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <LibGUI/FontPickerWeightModel.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/ListView.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class Label;
|
|||
class Layout;
|
||||
class ListView;
|
||||
class Menu;
|
||||
class MenuBar;
|
||||
class Menubar;
|
||||
class MenuItem;
|
||||
class Model;
|
||||
class ModelEditingDelegate;
|
||||
|
@ -73,14 +73,14 @@ class RadioButton;
|
|||
class ResizeCorner;
|
||||
class ResizeEvent;
|
||||
class ScreenRectChangeEvent;
|
||||
class ScrollBar;
|
||||
class Scrollbar;
|
||||
class ScrollableWidget;
|
||||
class Slider;
|
||||
class SortingProxyModel;
|
||||
class SpinBox;
|
||||
class Splitter;
|
||||
class StackWidget;
|
||||
class StatusBar;
|
||||
class Statusbar;
|
||||
class TabWidget;
|
||||
class TableView;
|
||||
class TextBox;
|
||||
|
@ -90,8 +90,8 @@ struct TextDocumentSpan;
|
|||
class TextDocumentUndoCommand;
|
||||
class TextEditor;
|
||||
class ThemeChangeEvent;
|
||||
class ToolBar;
|
||||
class ToolBarContainer;
|
||||
class Toolbar;
|
||||
class ToolbarContainer;
|
||||
class TreeView;
|
||||
class Variant;
|
||||
class VerticalBoxLayout;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <LibGUI/IconView.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
namespace GUI {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <LibGUI/ListView.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, ListView)
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
bool is_visible() const { return m_visible; }
|
||||
|
||||
private:
|
||||
friend class MenuBar;
|
||||
friend class Menubar;
|
||||
|
||||
int realize_menu(RefPtr<Action> default_action = nullptr);
|
||||
void unrealize_menu();
|
||||
|
|
|
@ -26,34 +26,34 @@
|
|||
|
||||
#include <AK/Badge.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/MenuItem.h>
|
||||
#include <LibGUI/Menubar.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
MenuBar::MenuBar()
|
||||
Menubar::Menubar()
|
||||
{
|
||||
}
|
||||
|
||||
MenuBar::~MenuBar()
|
||||
Menubar::~Menubar()
|
||||
{
|
||||
unrealize_menubar();
|
||||
}
|
||||
|
||||
Menu& MenuBar::add_menu(String name)
|
||||
Menu& Menubar::add_menu(String name)
|
||||
{
|
||||
auto& menu = add<Menu>(move(name));
|
||||
m_menus.append(menu);
|
||||
return menu;
|
||||
}
|
||||
|
||||
int MenuBar::realize_menubar()
|
||||
int Menubar::realize_menubar()
|
||||
{
|
||||
return WindowServerConnection::the().send_sync<Messages::WindowServer::CreateMenubar>()->menubar_id();
|
||||
}
|
||||
|
||||
void MenuBar::unrealize_menubar()
|
||||
void Menubar::unrealize_menubar()
|
||||
{
|
||||
if (m_menubar_id == -1)
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ void MenuBar::unrealize_menubar()
|
|||
m_menubar_id = -1;
|
||||
}
|
||||
|
||||
void MenuBar::notify_added_to_window(Badge<Window>)
|
||||
void Menubar::notify_added_to_window(Badge<Window>)
|
||||
{
|
||||
VERIFY(m_menubar_id == -1);
|
||||
m_menubar_id = realize_menubar();
|
||||
|
@ -73,7 +73,7 @@ void MenuBar::notify_added_to_window(Badge<Window>)
|
|||
}
|
||||
}
|
||||
|
||||
void MenuBar::notify_removed_from_window(Badge<Window>)
|
||||
void Menubar::notify_removed_from_window(Badge<Window>)
|
||||
{
|
||||
unrealize_menubar();
|
||||
}
|
|
@ -33,11 +33,11 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class MenuBar : public Core::Object {
|
||||
C_OBJECT(MenuBar);
|
||||
class Menubar : public Core::Object {
|
||||
C_OBJECT(Menubar);
|
||||
|
||||
public:
|
||||
~MenuBar();
|
||||
~Menubar();
|
||||
|
||||
Menu& add_menu(String name);
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
int menubar_id() const { return m_menubar_id; }
|
||||
|
||||
private:
|
||||
MenuBar();
|
||||
Menubar();
|
||||
|
||||
int realize_menubar();
|
||||
void unrealize_menubar();
|
|
@ -27,16 +27,16 @@
|
|||
#include <AK/Assertions.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ProgressBar.h>
|
||||
#include <LibGUI/Progressbar.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, ProgressBar)
|
||||
REGISTER_WIDGET(GUI, VerticalProgressBar)
|
||||
REGISTER_WIDGET(GUI, HorizontalProgressBar)
|
||||
REGISTER_WIDGET(GUI, Progressbar)
|
||||
REGISTER_WIDGET(GUI, VerticalProgressbar)
|
||||
REGISTER_WIDGET(GUI, HorizontalProgressbar)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
ProgressBar::ProgressBar(Orientation orientation)
|
||||
Progressbar::Progressbar(Orientation orientation)
|
||||
: m_orientation(orientation)
|
||||
{
|
||||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
|
@ -48,11 +48,11 @@ ProgressBar::ProgressBar(Orientation orientation)
|
|||
REGISTER_INT_PROPERTY("max", max, set_max);
|
||||
}
|
||||
|
||||
ProgressBar::~ProgressBar()
|
||||
Progressbar::~Progressbar()
|
||||
{
|
||||
}
|
||||
|
||||
void ProgressBar::set_value(int value)
|
||||
void Progressbar::set_value(int value)
|
||||
{
|
||||
if (m_value == value)
|
||||
return;
|
||||
|
@ -60,7 +60,7 @@ void ProgressBar::set_value(int value)
|
|||
update();
|
||||
}
|
||||
|
||||
void ProgressBar::set_range(int min, int max)
|
||||
void Progressbar::set_range(int min, int max)
|
||||
{
|
||||
VERIFY(min <= max);
|
||||
m_min = min;
|
||||
|
@ -68,7 +68,7 @@ void ProgressBar::set_range(int min, int max)
|
|||
m_value = clamp(m_value, m_min, m_max);
|
||||
}
|
||||
|
||||
void ProgressBar::paint_event(PaintEvent& event)
|
||||
void Progressbar::paint_event(PaintEvent& event)
|
||||
{
|
||||
Frame::paint_event(event);
|
||||
|
||||
|
@ -93,10 +93,10 @@ void ProgressBar::paint_event(PaintEvent& event)
|
|||
progress_text = builder.to_string();
|
||||
}
|
||||
|
||||
Gfx::StylePainter::paint_progress_bar(painter, rect, palette(), m_min, m_max, m_value, progress_text, m_orientation);
|
||||
Gfx::StylePainter::paint_progressbar(painter, rect, palette(), m_min, m_max, m_value, progress_text, m_orientation);
|
||||
}
|
||||
|
||||
void ProgressBar::set_orientation(Orientation value)
|
||||
void Progressbar::set_orientation(Orientation value)
|
||||
{
|
||||
if (m_orientation == value)
|
||||
return;
|
|
@ -30,10 +30,10 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class ProgressBar : public Frame {
|
||||
C_OBJECT(ProgressBar)
|
||||
class Progressbar : public Frame {
|
||||
C_OBJECT(Progressbar)
|
||||
public:
|
||||
virtual ~ProgressBar() override;
|
||||
virtual ~Progressbar() override;
|
||||
|
||||
void set_range(int min, int max);
|
||||
void set_min(int min) { set_range(min, max()); }
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
void set_format(Format format) { m_format = format; }
|
||||
|
||||
protected:
|
||||
ProgressBar(Orientation = Orientation::Horizontal);
|
||||
Progressbar(Orientation = Orientation::Horizontal);
|
||||
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
|
||||
|
@ -72,28 +72,28 @@ private:
|
|||
Orientation m_orientation { Orientation::Horizontal };
|
||||
};
|
||||
|
||||
class VerticalProgressBar final : public ProgressBar {
|
||||
C_OBJECT(VerticalProgressBar);
|
||||
class VerticalProgressbar final : public Progressbar {
|
||||
C_OBJECT(VerticalProgressbar);
|
||||
|
||||
public:
|
||||
virtual ~VerticalProgressBar() override { }
|
||||
virtual ~VerticalProgressbar() override { }
|
||||
|
||||
private:
|
||||
VerticalProgressBar()
|
||||
: ProgressBar(Orientation::Vertical)
|
||||
VerticalProgressbar()
|
||||
: Progressbar(Orientation::Vertical)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class HorizontalProgressBar final : public ProgressBar {
|
||||
C_OBJECT(HorizontalProgressBar);
|
||||
class HorizontalProgressbar final : public Progressbar {
|
||||
C_OBJECT(HorizontalProgressbar);
|
||||
|
||||
public:
|
||||
virtual ~HorizontalProgressBar() override { }
|
||||
virtual ~HorizontalProgressbar() override { }
|
||||
|
||||
private:
|
||||
HorizontalProgressBar()
|
||||
: ProgressBar(Orientation::Horizontal)
|
||||
HorizontalProgressbar()
|
||||
: Progressbar(Orientation::Horizontal)
|
||||
{
|
||||
}
|
||||
};
|
|
@ -24,21 +24,21 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/ScrollableWidget.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
ScrollableWidget::ScrollableWidget()
|
||||
{
|
||||
m_vertical_scrollbar = add<ScrollableWidgetScrollBar>(*this, Orientation::Vertical);
|
||||
m_vertical_scrollbar = add<ScrollableWidgetScrollbar>(*this, Orientation::Vertical);
|
||||
m_vertical_scrollbar->set_step(4);
|
||||
m_vertical_scrollbar->on_change = [this](int) {
|
||||
did_scroll();
|
||||
update();
|
||||
};
|
||||
|
||||
m_horizontal_scrollbar = add<ScrollableWidgetScrollBar>(*this, Orientation::Horizontal);
|
||||
m_horizontal_scrollbar = add<ScrollableWidgetScrollbar>(*this, Orientation::Horizontal);
|
||||
m_horizontal_scrollbar->set_step(4);
|
||||
m_horizontal_scrollbar->set_page_step(30);
|
||||
m_horizontal_scrollbar->on_change = [this](int) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
@ -60,10 +60,10 @@ public:
|
|||
Gfx::IntSize available_size() const;
|
||||
Gfx::IntSize excess_size() const;
|
||||
|
||||
ScrollBar& vertical_scrollbar() { return *m_vertical_scrollbar; }
|
||||
const ScrollBar& vertical_scrollbar() const { return *m_vertical_scrollbar; }
|
||||
ScrollBar& horizontal_scrollbar() { return *m_horizontal_scrollbar; }
|
||||
const ScrollBar& horizontal_scrollbar() const { return *m_horizontal_scrollbar; }
|
||||
Scrollbar& vertical_scrollbar() { return *m_vertical_scrollbar; }
|
||||
const Scrollbar& vertical_scrollbar() const { return *m_vertical_scrollbar; }
|
||||
Scrollbar& horizontal_scrollbar() { return *m_horizontal_scrollbar; }
|
||||
const Scrollbar& horizontal_scrollbar() const { return *m_horizontal_scrollbar; }
|
||||
Widget& corner_widget() { return *m_corner_widget; }
|
||||
const Widget& corner_widget() const { return *m_corner_widget; }
|
||||
|
||||
|
@ -92,12 +92,12 @@ protected:
|
|||
void set_size_occupied_by_fixed_elements(const Gfx::IntSize&);
|
||||
|
||||
private:
|
||||
class ScrollableWidgetScrollBar final : public ScrollBar {
|
||||
C_OBJECT(ScrollableWidgetScrollBar);
|
||||
class ScrollableWidgetScrollbar final : public Scrollbar {
|
||||
C_OBJECT(ScrollableWidgetScrollbar);
|
||||
|
||||
protected:
|
||||
explicit ScrollableWidgetScrollBar(ScrollableWidget& owner, Gfx::Orientation orientation)
|
||||
: ScrollBar(orientation)
|
||||
explicit ScrollableWidgetScrollbar(ScrollableWidget& owner, Gfx::Orientation orientation)
|
||||
: Scrollbar(orientation)
|
||||
, m_owner(owner)
|
||||
{
|
||||
}
|
||||
|
@ -110,13 +110,13 @@ private:
|
|||
private:
|
||||
ScrollableWidget& m_owner;
|
||||
};
|
||||
friend class ScrollableWidgetScrollBar;
|
||||
friend class ScrollableWidgetScrollbar;
|
||||
|
||||
void update_scrollbar_ranges();
|
||||
void handle_wheel_event(MouseEvent&, Widget&);
|
||||
|
||||
RefPtr<ScrollableWidgetScrollBar> m_vertical_scrollbar;
|
||||
RefPtr<ScrollableWidgetScrollBar> m_horizontal_scrollbar;
|
||||
RefPtr<ScrollableWidgetScrollbar> m_vertical_scrollbar;
|
||||
RefPtr<ScrollableWidgetScrollbar> m_horizontal_scrollbar;
|
||||
RefPtr<Widget> m_corner_widget;
|
||||
Gfx::IntSize m_content_size;
|
||||
Gfx::IntSize m_size_occupied_by_fixed_elements;
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGfx/CharacterBitmap.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, ScrollBar)
|
||||
REGISTER_WIDGET(GUI, Scrollbar)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
@ -88,7 +88,7 @@ static Gfx::CharacterBitmap* s_down_arrow_bitmap;
|
|||
static Gfx::CharacterBitmap* s_left_arrow_bitmap;
|
||||
static Gfx::CharacterBitmap* s_right_arrow_bitmap;
|
||||
|
||||
ScrollBar::ScrollBar(Orientation orientation)
|
||||
Scrollbar::Scrollbar(Orientation orientation)
|
||||
: AbstractSlider(orientation)
|
||||
{
|
||||
m_automatic_scrolling_timer = add<Core::Timer>();
|
||||
|
@ -113,16 +113,16 @@ ScrollBar::ScrollBar(Orientation orientation)
|
|||
};
|
||||
}
|
||||
|
||||
ScrollBar::~ScrollBar()
|
||||
Scrollbar::~Scrollbar()
|
||||
{
|
||||
}
|
||||
|
||||
Gfx::IntRect ScrollBar::decrement_button_rect() const
|
||||
Gfx::IntRect Scrollbar::decrement_button_rect() const
|
||||
{
|
||||
return { 0, 0, button_width(), button_height() };
|
||||
}
|
||||
|
||||
Gfx::IntRect ScrollBar::increment_button_rect() const
|
||||
Gfx::IntRect Scrollbar::increment_button_rect() const
|
||||
{
|
||||
if (orientation() == Orientation::Vertical)
|
||||
return { 0, height() - button_height(), button_width(), button_height() };
|
||||
|
@ -130,7 +130,7 @@ Gfx::IntRect ScrollBar::increment_button_rect() const
|
|||
return { width() - button_width(), 0, button_width(), button_height() };
|
||||
}
|
||||
|
||||
Gfx::IntRect ScrollBar::decrement_gutter_rect() const
|
||||
Gfx::IntRect Scrollbar::decrement_gutter_rect() const
|
||||
{
|
||||
if (orientation() == Orientation::Vertical)
|
||||
return { 0, button_height(), button_width(), scrubber_rect().top() - button_height() };
|
||||
|
@ -138,7 +138,7 @@ Gfx::IntRect ScrollBar::decrement_gutter_rect() const
|
|||
return { button_width(), 0, scrubber_rect().x() - button_width(), button_height() };
|
||||
}
|
||||
|
||||
Gfx::IntRect ScrollBar::increment_gutter_rect() const
|
||||
Gfx::IntRect Scrollbar::increment_gutter_rect() const
|
||||
{
|
||||
auto scrubber_rect = this->scrubber_rect();
|
||||
if (orientation() == Orientation::Vertical)
|
||||
|
@ -147,7 +147,7 @@ Gfx::IntRect ScrollBar::increment_gutter_rect() const
|
|||
return { scrubber_rect.right() + 1, 0, width() - button_width() - scrubber_rect.right() - 1, button_width() };
|
||||
}
|
||||
|
||||
int ScrollBar::scrubbable_range_in_pixels() const
|
||||
int Scrollbar::scrubbable_range_in_pixels() const
|
||||
{
|
||||
if (orientation() == Orientation::Vertical)
|
||||
return height() - button_height() * 2 - visible_scrubber_size();
|
||||
|
@ -155,12 +155,12 @@ int ScrollBar::scrubbable_range_in_pixels() const
|
|||
return width() - button_width() * 2 - visible_scrubber_size();
|
||||
}
|
||||
|
||||
bool ScrollBar::has_scrubber() const
|
||||
bool Scrollbar::has_scrubber() const
|
||||
{
|
||||
return max() != min();
|
||||
}
|
||||
|
||||
int ScrollBar::unclamped_scrubber_size() const
|
||||
int Scrollbar::unclamped_scrubber_size() const
|
||||
{
|
||||
int pixel_range = length(orientation()) - button_size() * 2;
|
||||
int value_range = max() - min();
|
||||
|
@ -174,12 +174,12 @@ int ScrollBar::unclamped_scrubber_size() const
|
|||
return scrubber_size;
|
||||
}
|
||||
|
||||
int ScrollBar::visible_scrubber_size() const
|
||||
int Scrollbar::visible_scrubber_size() const
|
||||
{
|
||||
return ::max(unclamped_scrubber_size(), button_size());
|
||||
}
|
||||
|
||||
Gfx::IntRect ScrollBar::scrubber_rect() const
|
||||
Gfx::IntRect Scrollbar::scrubber_rect() const
|
||||
{
|
||||
if (!has_scrubber() || length(orientation()) <= (button_size() * 2) + visible_scrubber_size())
|
||||
return {};
|
||||
|
@ -201,7 +201,7 @@ Gfx::IntRect ScrollBar::scrubber_rect() const
|
|||
return { (int)x_or_y, 0, visible_scrubber_size(), button_height() };
|
||||
}
|
||||
|
||||
void ScrollBar::paint_event(PaintEvent& event)
|
||||
void Scrollbar::paint_event(PaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.add_clip_rect(event.rect());
|
||||
|
@ -238,7 +238,7 @@ void ScrollBar::paint_event(PaintEvent& event)
|
|||
Gfx::StylePainter::paint_button(painter, scrubber_rect(), palette(), Gfx::ButtonStyle::Normal, false, hovered_component_for_painting == Component::Scrubber || m_pressed_component == Component::Scrubber);
|
||||
}
|
||||
|
||||
void ScrollBar::on_automatic_scrolling_timer_fired()
|
||||
void Scrollbar::on_automatic_scrolling_timer_fired()
|
||||
{
|
||||
if (m_pressed_component == Component::DecrementButton && component_at_position(m_last_mouse_position) == Component::DecrementButton) {
|
||||
set_value(value() - step());
|
||||
|
@ -255,7 +255,7 @@ void ScrollBar::on_automatic_scrolling_timer_fired()
|
|||
}
|
||||
}
|
||||
|
||||
void ScrollBar::mousedown_event(MouseEvent& event)
|
||||
void Scrollbar::mousedown_event(MouseEvent& event)
|
||||
{
|
||||
if (event.button() != MouseButton::Left)
|
||||
return;
|
||||
|
@ -294,7 +294,7 @@ void ScrollBar::mousedown_event(MouseEvent& event)
|
|||
update();
|
||||
}
|
||||
|
||||
void ScrollBar::mouseup_event(MouseEvent& event)
|
||||
void Scrollbar::mouseup_event(MouseEvent& event)
|
||||
{
|
||||
if (event.button() != MouseButton::Left)
|
||||
return;
|
||||
|
@ -302,7 +302,7 @@ void ScrollBar::mouseup_event(MouseEvent& event)
|
|||
update();
|
||||
}
|
||||
|
||||
void ScrollBar::mousewheel_event(MouseEvent& event)
|
||||
void Scrollbar::mousewheel_event(MouseEvent& event)
|
||||
{
|
||||
if (!is_scrollable())
|
||||
return;
|
||||
|
@ -310,7 +310,7 @@ void ScrollBar::mousewheel_event(MouseEvent& event)
|
|||
Widget::mousewheel_event(event);
|
||||
}
|
||||
|
||||
void ScrollBar::set_automatic_scrolling_active(bool active, Component pressed_component)
|
||||
void Scrollbar::set_automatic_scrolling_active(bool active, Component pressed_component)
|
||||
{
|
||||
m_pressed_component = pressed_component;
|
||||
if (m_pressed_component == Component::Gutter)
|
||||
|
@ -326,7 +326,7 @@ void ScrollBar::set_automatic_scrolling_active(bool active, Component pressed_co
|
|||
}
|
||||
}
|
||||
|
||||
void ScrollBar::scroll_by_page(const Gfx::IntPoint& click_position)
|
||||
void Scrollbar::scroll_by_page(const Gfx::IntPoint& click_position)
|
||||
{
|
||||
float range_size = max() - min();
|
||||
float available = scrubbable_range_in_pixels();
|
||||
|
@ -339,7 +339,7 @@ void ScrollBar::scroll_by_page(const Gfx::IntPoint& click_position)
|
|||
set_value(value() + page_increment);
|
||||
}
|
||||
|
||||
void ScrollBar::scroll_to_position(const Gfx::IntPoint& click_position)
|
||||
void Scrollbar::scroll_to_position(const Gfx::IntPoint& click_position)
|
||||
{
|
||||
float range_size = max() - min();
|
||||
float available = scrubbable_range_in_pixels();
|
||||
|
@ -349,7 +349,7 @@ void ScrollBar::scroll_to_position(const Gfx::IntPoint& click_position)
|
|||
set_value(min() + rel_x_or_y * range_size);
|
||||
}
|
||||
|
||||
ScrollBar::Component ScrollBar::component_at_position(const Gfx::IntPoint& position)
|
||||
Scrollbar::Component Scrollbar::component_at_position(const Gfx::IntPoint& position)
|
||||
{
|
||||
if (scrubber_rect().contains(position))
|
||||
return Component::Scrubber;
|
||||
|
@ -362,7 +362,7 @@ ScrollBar::Component ScrollBar::component_at_position(const Gfx::IntPoint& posit
|
|||
return Component::None;
|
||||
}
|
||||
|
||||
void ScrollBar::mousemove_event(MouseEvent& event)
|
||||
void Scrollbar::mousemove_event(MouseEvent& event)
|
||||
{
|
||||
m_last_mouse_position = event.position();
|
||||
|
||||
|
@ -380,7 +380,7 @@ void ScrollBar::mousemove_event(MouseEvent& event)
|
|||
set_value(new_value);
|
||||
}
|
||||
|
||||
void ScrollBar::leave_event(Core::Event&)
|
||||
void Scrollbar::leave_event(Core::Event&)
|
||||
{
|
||||
if (m_hovered_component != Component::None) {
|
||||
m_hovered_component = Component::None;
|
||||
|
@ -388,7 +388,7 @@ void ScrollBar::leave_event(Core::Event&)
|
|||
}
|
||||
}
|
||||
|
||||
void ScrollBar::change_event(Event& event)
|
||||
void Scrollbar::change_event(Event& event)
|
||||
{
|
||||
if (event.type() == Event::Type::EnabledChange) {
|
||||
if (!is_enabled())
|
|
@ -31,11 +31,11 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class ScrollBar : public AbstractSlider {
|
||||
C_OBJECT(ScrollBar);
|
||||
class Scrollbar : public AbstractSlider {
|
||||
C_OBJECT(Scrollbar);
|
||||
|
||||
public:
|
||||
virtual ~ScrollBar() override;
|
||||
virtual ~Scrollbar() override;
|
||||
|
||||
bool is_scrollable() const { return max() != min(); }
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
};
|
||||
|
||||
protected:
|
||||
explicit ScrollBar(Gfx::Orientation = Gfx::Orientation::Vertical);
|
||||
explicit Scrollbar(Gfx::Orientation = Gfx::Orientation::Vertical);
|
||||
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
virtual void mousedown_event(MouseEvent&) override;
|
|
@ -28,16 +28,16 @@
|
|||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ResizeCorner.h>
|
||||
#include <LibGUI/StatusBar.h>
|
||||
#include <LibGUI/Statusbar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, StatusBar)
|
||||
REGISTER_WIDGET(GUI, Statusbar)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
StatusBar::StatusBar(int label_count)
|
||||
Statusbar::Statusbar(int label_count)
|
||||
{
|
||||
set_fixed_height(18);
|
||||
set_layout<HorizontalBoxLayout>();
|
||||
|
@ -55,11 +55,11 @@ StatusBar::StatusBar(int label_count)
|
|||
REGISTER_STRING_PROPERTY("text", text, set_text);
|
||||
}
|
||||
|
||||
StatusBar::~StatusBar()
|
||||
Statusbar::~Statusbar()
|
||||
{
|
||||
}
|
||||
|
||||
NonnullRefPtr<Label> StatusBar::create_label()
|
||||
NonnullRefPtr<Label> Statusbar::create_label()
|
||||
{
|
||||
auto& label = add<Label>();
|
||||
label.set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||
|
@ -69,34 +69,34 @@ NonnullRefPtr<Label> StatusBar::create_label()
|
|||
return label;
|
||||
}
|
||||
|
||||
void StatusBar::set_text(const StringView& text)
|
||||
void Statusbar::set_text(const StringView& text)
|
||||
{
|
||||
m_labels.first().set_text(text);
|
||||
}
|
||||
|
||||
String StatusBar::text() const
|
||||
String Statusbar::text() const
|
||||
{
|
||||
return m_labels.first().text();
|
||||
}
|
||||
|
||||
void StatusBar::set_text(int index, const StringView& text)
|
||||
void Statusbar::set_text(int index, const StringView& text)
|
||||
{
|
||||
m_labels.at(index).set_text(text);
|
||||
}
|
||||
|
||||
String StatusBar::text(int index) const
|
||||
String Statusbar::text(int index) const
|
||||
{
|
||||
return m_labels.at(index).text();
|
||||
}
|
||||
|
||||
void StatusBar::paint_event(PaintEvent& event)
|
||||
void Statusbar::paint_event(PaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.add_clip_rect(event.rect());
|
||||
painter.fill_rect(rect(), palette().button());
|
||||
}
|
||||
|
||||
void StatusBar::resize_event(ResizeEvent& event)
|
||||
void Statusbar::resize_event(ResizeEvent& event)
|
||||
{
|
||||
if (window())
|
||||
m_corner->set_visible(window()->is_maximized() ? false : true);
|
|
@ -30,10 +30,10 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class StatusBar : public Widget {
|
||||
C_OBJECT(StatusBar)
|
||||
class Statusbar : public Widget {
|
||||
C_OBJECT(Statusbar)
|
||||
public:
|
||||
virtual ~StatusBar() override;
|
||||
virtual ~Statusbar() override;
|
||||
|
||||
String text() const;
|
||||
String text(int index) const;
|
||||
|
@ -41,7 +41,7 @@ public:
|
|||
void set_text(int index, const StringView&);
|
||||
|
||||
protected:
|
||||
explicit StatusBar(int label_count = 1);
|
||||
explicit Statusbar(int label_count = 1);
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
virtual void resize_event(ResizeEvent&) override;
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/ModelEditingDelegate.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/TableView.h>
|
||||
#include <LibGUI/TextBox.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/RegularEditingEngine.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
|
|
@ -32,14 +32,14 @@
|
|||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/SeparatorWidget.h>
|
||||
#include <LibGUI/ToolBar.h>
|
||||
#include <LibGUI/Toolbar.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, ToolBar)
|
||||
REGISTER_WIDGET(GUI, Toolbar)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
ToolBar::ToolBar(Orientation orientation, int button_size)
|
||||
Toolbar::Toolbar(Orientation orientation, int button_size)
|
||||
: m_orientation(orientation)
|
||||
, m_button_size(button_size)
|
||||
{
|
||||
|
@ -53,18 +53,18 @@ ToolBar::ToolBar(Orientation orientation, int button_size)
|
|||
layout()->set_margins({ 2, 2, 2, 2 });
|
||||
}
|
||||
|
||||
ToolBar::~ToolBar()
|
||||
Toolbar::~Toolbar()
|
||||
{
|
||||
}
|
||||
|
||||
class ToolBarButton final : public Button {
|
||||
C_OBJECT(ToolBarButton);
|
||||
class ToolbarButton final : public Button {
|
||||
C_OBJECT(ToolbarButton);
|
||||
|
||||
public:
|
||||
virtual ~ToolBarButton() override { }
|
||||
virtual ~ToolbarButton() override { }
|
||||
|
||||
private:
|
||||
explicit ToolBarButton(Action& action)
|
||||
explicit ToolbarButton(Action& action)
|
||||
{
|
||||
if (action.group() && action.group()->is_exclusive())
|
||||
set_exclusive(true);
|
||||
|
@ -75,7 +75,7 @@ private:
|
|||
set_icon(action.icon());
|
||||
else
|
||||
set_text(action.text());
|
||||
set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
set_button_style(Gfx::ButtonStyle::Coolbar);
|
||||
}
|
||||
String tooltip(const Action& action) const
|
||||
{
|
||||
|
@ -90,19 +90,19 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
void ToolBar::add_action(Action& action)
|
||||
void Toolbar::add_action(Action& action)
|
||||
{
|
||||
auto item = make<Item>();
|
||||
item->type = Item::Type::Action;
|
||||
item->action = action;
|
||||
|
||||
auto& button = add<ToolBarButton>(action);
|
||||
auto& button = add<ToolbarButton>(action);
|
||||
button.set_fixed_size(m_button_size + 8, m_button_size + 8);
|
||||
|
||||
m_items.append(move(item));
|
||||
}
|
||||
|
||||
void ToolBar::add_separator()
|
||||
void Toolbar::add_separator()
|
||||
{
|
||||
auto item = make<Item>();
|
||||
item->type = Item::Type::Separator;
|
||||
|
@ -110,7 +110,7 @@ void ToolBar::add_separator()
|
|||
m_items.append(move(item));
|
||||
}
|
||||
|
||||
void ToolBar::paint_event(PaintEvent& event)
|
||||
void Toolbar::paint_event(PaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.add_clip_rect(event.rect());
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class ToolBar : public Widget {
|
||||
C_OBJECT(ToolBar)
|
||||
class Toolbar : public Widget {
|
||||
C_OBJECT(Toolbar)
|
||||
public:
|
||||
virtual ~ToolBar() override;
|
||||
virtual ~Toolbar() override;
|
||||
|
||||
void add_action(Action&);
|
||||
void add_separator();
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
void set_has_frame(bool has_frame) { m_has_frame = has_frame; }
|
||||
|
||||
protected:
|
||||
explicit ToolBar(Gfx::Orientation = Gfx::Orientation::Horizontal, int button_size = 16);
|
||||
explicit Toolbar(Gfx::Orientation = Gfx::Orientation::Horizontal, int button_size = 16);
|
||||
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
|
|
@ -26,15 +26,15 @@
|
|||
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ToolBarContainer.h>
|
||||
#include <LibGUI/ToolbarContainer.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, ToolBarContainer)
|
||||
REGISTER_WIDGET(GUI, ToolbarContainer)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
ToolBarContainer::ToolBarContainer(Gfx::Orientation orientation)
|
||||
ToolbarContainer::ToolbarContainer(Gfx::Orientation orientation)
|
||||
: m_orientation(orientation)
|
||||
{
|
||||
set_fill_with_background_color(true);
|
||||
|
@ -50,7 +50,7 @@ ToolBarContainer::ToolBarContainer(Gfx::Orientation orientation)
|
|||
set_shrink_to_fit(true);
|
||||
}
|
||||
|
||||
void ToolBarContainer::paint_event(GUI::PaintEvent& event)
|
||||
void ToolbarContainer::paint_event(GUI::PaintEvent& event)
|
||||
{
|
||||
Painter painter(*this);
|
||||
painter.add_clip_rect(event.rect());
|
|
@ -27,16 +27,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGUI/ToolBar.h>
|
||||
#include <LibGUI/Toolbar.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class ToolBarContainer : public Frame {
|
||||
C_OBJECT(ToolBarContainer);
|
||||
class ToolbarContainer : public Frame {
|
||||
C_OBJECT(ToolbarContainer);
|
||||
|
||||
public:
|
||||
private:
|
||||
explicit ToolBarContainer(Gfx::Orientation = Gfx::Orientation::Horizontal);
|
||||
explicit ToolbarContainer(Gfx::Orientation = Gfx::Orientation::Horizontal);
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
#include <LibGUI/HeaderView.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/TreeView.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Menubar.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
@ -1084,7 +1084,7 @@ Gfx::Bitmap* Window::back_bitmap()
|
|||
return m_back_store ? &m_back_store->bitmap() : nullptr;
|
||||
}
|
||||
|
||||
void Window::set_menubar(RefPtr<MenuBar> menubar)
|
||||
void Window::set_menubar(RefPtr<Menubar> menubar)
|
||||
{
|
||||
if (m_menubar == menubar)
|
||||
return;
|
||||
|
|
|
@ -211,7 +211,7 @@ public:
|
|||
|
||||
void did_disable_focused_widget(Badge<Widget>);
|
||||
|
||||
void set_menubar(RefPtr<MenuBar>);
|
||||
void set_menubar(RefPtr<Menubar>);
|
||||
|
||||
protected:
|
||||
Window(Core::Object* parent = nullptr);
|
||||
|
@ -245,7 +245,7 @@ private:
|
|||
OwnPtr<WindowBackingStore> m_front_store;
|
||||
OwnPtr<WindowBackingStore> m_back_store;
|
||||
|
||||
RefPtr<MenuBar> m_menubar;
|
||||
RefPtr<Menubar> m_menubar;
|
||||
|
||||
RefPtr<Gfx::Bitmap> m_icon;
|
||||
RefPtr<Gfx::Bitmap> m_custom_cursor;
|
||||
|
|
|
@ -165,12 +165,12 @@ void ClassicStylePainter::paint_button(Painter& painter, const IntRect& rect, co
|
|||
if (button_style == ButtonStyle::Normal)
|
||||
return paint_button_new(painter, rect, palette, pressed, checked, hovered, enabled, focused);
|
||||
|
||||
if (button_style == ButtonStyle::CoolBar && !enabled)
|
||||
if (button_style == ButtonStyle::Coolbar && !enabled)
|
||||
return;
|
||||
|
||||
Color button_color = palette.button();
|
||||
Color highlight_color = palette.threed_highlight();
|
||||
Color shadow_color = button_style == ButtonStyle::CoolBar ? palette.threed_shadow1() : palette.threed_shadow2();
|
||||
Color shadow_color = button_style == ButtonStyle::Coolbar ? palette.threed_shadow1() : palette.threed_shadow2();
|
||||
|
||||
PainterStateSaver saver(painter);
|
||||
painter.translate(rect.location());
|
||||
|
@ -178,7 +178,7 @@ void ClassicStylePainter::paint_button(Painter& painter, const IntRect& rect, co
|
|||
if (pressed || checked) {
|
||||
// Base
|
||||
IntRect base_rect { 1, 1, rect.width() - 2, rect.height() - 2 };
|
||||
if (button_style == ButtonStyle::CoolBar) {
|
||||
if (button_style == ButtonStyle::Coolbar) {
|
||||
if (checked && !pressed) {
|
||||
painter.fill_rect_with_dither_pattern(base_rect, palette.button().lightened(1.3f), Color());
|
||||
} else {
|
||||
|
@ -194,7 +194,7 @@ void ClassicStylePainter::paint_button(Painter& painter, const IntRect& rect, co
|
|||
painter.draw_line({ rect.width() - 2, 1 }, { rect.width() - 2, rect.height() - 3 }, highlight_color);
|
||||
painter.draw_line({ 1, rect.height() - 2 }, { rect.width() - 2, rect.height() - 2 }, highlight_color);
|
||||
} else if (hovered) {
|
||||
if (button_style == ButtonStyle::CoolBar) {
|
||||
if (button_style == ButtonStyle::Coolbar) {
|
||||
// Base
|
||||
painter.fill_rect({ 1, 1, rect.width() - 2, rect.height() - 2 }, button_color);
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ void ClassicStylePainter::paint_window_frame(Painter& painter, const IntRect& re
|
|||
painter.draw_line(rect.bottom_left().translated(3, -3), rect.bottom_right().translated(-3, -3), base_color);
|
||||
}
|
||||
|
||||
void ClassicStylePainter::paint_progress_bar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, const StringView& text, Orientation orientation)
|
||||
void ClassicStylePainter::paint_progressbar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, const StringView& text, Orientation orientation)
|
||||
{
|
||||
// First we fill the entire widget with the gradient. This incurs a bit of
|
||||
// overdraw but ensures a consistent look throughout the progression.
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
void paint_surface(Painter&, const IntRect&, const Palette&, bool paint_vertical_lines = true, bool paint_top_line = true) override;
|
||||
void paint_frame(Painter&, const IntRect&, const Palette&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false) override;
|
||||
void paint_window_frame(Painter&, const IntRect&, const Palette&) override;
|
||||
void paint_progress_bar(Painter&, const IntRect&, const Palette&, int min, int max, int value, const StringView& text, Orientation = Orientation::Horizontal) override;
|
||||
void paint_progressbar(Painter&, const IntRect&, const Palette&, int min, int max, int value, const StringView& text, Orientation = Orientation::Horizontal) override;
|
||||
void paint_radio_button(Painter&, const IntRect&, const Palette&, bool is_checked, bool is_being_pressed) override;
|
||||
void paint_check_box(Painter&, const IntRect&, const Palette&, bool is_enabled, bool is_checked, bool is_being_pressed) override;
|
||||
void paint_transparency_grid(Painter&, const IntRect&, const Palette&) override;
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
String active_window_shadow_path() const { return path(PathRole::ActiveWindowShadow); }
|
||||
String inactive_window_shadow_path() const { return path(PathRole::InactiveWindowShadow); }
|
||||
String menu_shadow_path() const { return path(PathRole::MenuShadow); }
|
||||
String task_bar_shadow_path() const { return path(PathRole::TaskBarShadow); }
|
||||
String taskbar_shadow_path() const { return path(PathRole::TaskbarShadow); }
|
||||
String tooltip_shadow_path() const { return path(PathRole::TooltipShadow); }
|
||||
|
||||
Color color(ColorRole role) const { return m_impl->color(role); }
|
||||
|
|
|
@ -63,9 +63,9 @@ void StylePainter::paint_window_frame(Painter& painter, const IntRect& rect, con
|
|||
current().paint_window_frame(painter, rect, palette);
|
||||
}
|
||||
|
||||
void StylePainter::paint_progress_bar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, const StringView& text, Orientation orientation)
|
||||
void StylePainter::paint_progressbar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, const StringView& text, Orientation orientation)
|
||||
{
|
||||
current().paint_progress_bar(painter, rect, palette, min, max, value, text, orientation);
|
||||
current().paint_progressbar(painter, rect, palette, min, max, value, text, orientation);
|
||||
}
|
||||
|
||||
void StylePainter::paint_radio_button(Painter& painter, const IntRect& rect, const Palette& palette, bool is_checked, bool is_being_pressed)
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Gfx {
|
|||
|
||||
enum class ButtonStyle {
|
||||
Normal,
|
||||
CoolBar,
|
||||
Coolbar,
|
||||
Tray,
|
||||
};
|
||||
enum class FrameShadow {
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
virtual void paint_surface(Painter&, const IntRect&, const Palette&, bool paint_vertical_lines = true, bool paint_top_line = true) = 0;
|
||||
virtual void paint_frame(Painter&, const IntRect&, const Palette&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false) = 0;
|
||||
virtual void paint_window_frame(Painter&, const IntRect&, const Palette&) = 0;
|
||||
virtual void paint_progress_bar(Painter&, const IntRect&, const Palette&, int min, int max, int value, const StringView& text, Orientation = Orientation::Horizontal) = 0;
|
||||
virtual void paint_progressbar(Painter&, const IntRect&, const Palette&, int min, int max, int value, const StringView& text, Orientation = Orientation::Horizontal) = 0;
|
||||
virtual void paint_radio_button(Painter&, const IntRect&, const Palette&, bool is_checked, bool is_being_pressed) = 0;
|
||||
virtual void paint_check_box(Painter&, const IntRect&, const Palette&, bool is_enabled, bool is_checked, bool is_being_pressed) = 0;
|
||||
virtual void paint_transparency_grid(Painter&, const IntRect&, const Palette&) = 0;
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
static void paint_surface(Painter&, const IntRect&, const Palette&, bool paint_vertical_lines = true, bool paint_top_line = true);
|
||||
static void paint_frame(Painter&, const IntRect&, const Palette&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
|
||||
static void paint_window_frame(Painter&, const IntRect&, const Palette&);
|
||||
static void paint_progress_bar(Painter&, const IntRect&, const Palette&, int min, int max, int value, const StringView& text, Orientation = Orientation::Horizontal);
|
||||
static void paint_progressbar(Painter&, const IntRect&, const Palette&, int min, int max, int value, const StringView& text, Orientation = Orientation::Horizontal);
|
||||
static void paint_radio_button(Painter&, const IntRect&, const Palette&, bool is_checked, bool is_being_pressed);
|
||||
static void paint_check_box(Painter&, const IntRect&, const Palette&, bool is_enabled, bool is_checked, bool is_being_pressed);
|
||||
static void paint_transparency_grid(Painter&, const IntRect&, const Palette&);
|
||||
|
|
|
@ -121,7 +121,7 @@ Core::AnonymousBuffer load_system_theme(const String& path)
|
|||
DO_PATH(TitleButtonIcons, false);
|
||||
DO_PATH(ActiveWindowShadow, true);
|
||||
DO_PATH(InactiveWindowShadow, true);
|
||||
DO_PATH(TaskBarShadow, true);
|
||||
DO_PATH(TaskbarShadow, true);
|
||||
DO_PATH(MenuShadow, true);
|
||||
DO_PATH(TooltipShadow, true);
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ enum class PathRole {
|
|||
TitleButtonIcons,
|
||||
InactiveWindowShadow,
|
||||
ActiveWindowShadow,
|
||||
TaskBarShadow,
|
||||
TaskbarShadow,
|
||||
MenuShadow,
|
||||
TooltipShadow,
|
||||
__Count,
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <LibGUI/Icon.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
|
@ -107,7 +107,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co
|
|||
m_visual_beep_timer = add<Core::Timer>();
|
||||
m_auto_scroll_timer = add<Core::Timer>();
|
||||
|
||||
m_scrollbar = add<GUI::ScrollBar>(Orientation::Vertical);
|
||||
m_scrollbar = add<GUI::Scrollbar>(Orientation::Vertical);
|
||||
m_scrollbar->set_relative_rect(0, 0, 16, 0);
|
||||
m_scrollbar->on_change = [this](int) {
|
||||
update();
|
||||
|
|
|
@ -210,7 +210,7 @@ private:
|
|||
RefPtr<Core::Timer> m_auto_scroll_timer;
|
||||
RefPtr<Core::ConfigFile> m_config;
|
||||
|
||||
RefPtr<GUI::ScrollBar> m_scrollbar;
|
||||
RefPtr<GUI::Scrollbar> m_scrollbar;
|
||||
|
||||
RefPtr<GUI::Action> m_copy_action;
|
||||
RefPtr<GUI::Action> m_paste_action;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/ShareableBitmap.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
#include <LibGUI/Scrollbar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue