1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:07:34 +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:
Andreas Kling 2021-04-13 16:18:20 +02:00
parent 86bdfa1edf
commit a2baab38fd
141 changed files with 518 additions and 518 deletions

View file

@ -80,7 +80,7 @@ ClockWidget::ClockWidget()
navigation_container.layout()->set_margins({ 2, 2, 3, 2 });
m_prev_date = navigation_container.add<GUI::Button>();
m_prev_date->set_button_style(Gfx::ButtonStyle::CoolBar);
m_prev_date->set_button_style(Gfx::ButtonStyle::Coolbar);
m_prev_date->set_fixed_size(24, 24);
m_prev_date->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"));
m_prev_date->on_click = [&](auto) {
@ -103,7 +103,7 @@ ClockWidget::ClockWidget()
};
m_selected_calendar_button = navigation_container.add<GUI::Button>();
m_selected_calendar_button->set_button_style(Gfx::ButtonStyle::CoolBar);
m_selected_calendar_button->set_button_style(Gfx::ButtonStyle::Coolbar);
m_selected_calendar_button->set_fixed_height(24);
m_selected_calendar_button->on_click = [&](auto) {
m_calendar->toggle_mode();
@ -114,7 +114,7 @@ ClockWidget::ClockWidget()
};
m_next_date = navigation_container.add<GUI::Button>();
m_next_date->set_button_style(Gfx::ButtonStyle::CoolBar);
m_next_date->set_button_style(Gfx::ButtonStyle::Coolbar);
m_next_date->set_fixed_size(24, 24);
m_next_date->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"));
m_next_date->on_click = [&](auto) {
@ -164,7 +164,7 @@ ClockWidget::ClockWidget()
settings_container.layout()->add_spacer();
m_jump_to_button = settings_container.add<GUI::Button>();
m_jump_to_button->set_button_style(Gfx::ButtonStyle::CoolBar);
m_jump_to_button->set_button_style(Gfx::ButtonStyle::Coolbar);
m_jump_to_button->set_fixed_size(24, 24);
m_jump_to_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/calendar-date.png"));
m_jump_to_button->set_tooltip("Jump to today");
@ -173,7 +173,7 @@ ClockWidget::ClockWidget()
};
m_calendar_launcher = settings_container.add<GUI::Button>();
m_calendar_launcher->set_button_style(Gfx::ButtonStyle::CoolBar);
m_calendar_launcher->set_button_style(Gfx::ButtonStyle::Coolbar);
m_calendar_launcher->set_fixed_size(24, 24);
m_calendar_launcher->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-calendar.png"));
m_calendar_launcher->set_tooltip("Calendar");

View file

@ -72,7 +72,7 @@ void TaskbarButton::resize_event(GUI::ResizeEvent& event)
return GUI::Button::resize_event(event);
}
static void paint_custom_progress_bar(GUI::Painter& painter, const Gfx::IntRect& rect, const Gfx::IntRect& text_rect, const Palette& palette, int min, int max, int value, const StringView& text, const Gfx::Font& font, Gfx::TextAlignment text_alignment)
static void paint_custom_progressbar(GUI::Painter& painter, const Gfx::IntRect& rect, const Gfx::IntRect& text_rect, const Palette& palette, int min, int max, int value, const StringView& text, const Gfx::Font& font, Gfx::TextAlignment text_alignment)
{
float range_size = max - min;
float progress = (value - min) / range_size;
@ -145,7 +145,7 @@ void TaskbarButton::paint_event(GUI::PaintEvent& event)
if (is_being_pressed() || is_checked()) {
adjusted_rect.set_height(adjusted_rect.height() + 1);
}
paint_custom_progress_bar(painter, adjusted_rect, text_rect, palette(), 0, 100, window.progress(), text(), font, text_alignment());
paint_custom_progressbar(painter, adjusted_rect, text_rect, palette(), 0, 100, window.progress(), text(), font, text_alignment());
}
if (is_enabled()) {

View file

@ -136,7 +136,7 @@ void TaskbarWindow::create_quick_launch_bar()
const int button_size = 24;
auto& button = quick_launch_bar.add<GUI::Button>();
button.set_fixed_size(button_size, button_size);
button.set_button_style(Gfx::ButtonStyle::CoolBar);
button.set_button_style(Gfx::ButtonStyle::Coolbar);
button.set_icon(af->icon().bitmap_for_size(16));
button.set_tooltip(af->name());
button.on_click = [app_executable](auto) {

View file

@ -9,7 +9,7 @@ set(SOURCES
Cursor.cpp
EventLoop.cpp
main.cpp
MenuBar.cpp
Menubar.cpp
Menu.cpp
MenuItem.cpp
MenuManager.cpp

View file

@ -32,8 +32,8 @@
#include <WindowServer/ClientConnection.h>
#include <WindowServer/Compositor.h>
#include <WindowServer/Menu.h>
#include <WindowServer/MenuBar.h>
#include <WindowServer/MenuItem.h>
#include <WindowServer/Menubar.h>
#include <WindowServer/Screen.h>
#include <WindowServer/Window.h>
#include <WindowServer/WindowClientEndpoint.h>
@ -104,7 +104,7 @@ void ClientConnection::notify_about_new_screen_rect(const Gfx::IntRect& rect)
OwnPtr<Messages::WindowServer::CreateMenubarResponse> ClientConnection::handle(const Messages::WindowServer::CreateMenubar&)
{
int menubar_id = m_next_menubar_id++;
auto menubar = MenuBar::create(*this, menubar_id);
auto menubar = Menubar::create(*this, menubar_id);
m_menubars.set(menubar_id, move(menubar));
return make<Messages::WindowServer::CreateMenubarResponse>(menubar_id);
}
@ -155,7 +155,7 @@ OwnPtr<Messages::WindowServer::SetWindowMenubarResponse> ClientConnection::handl
}
window = it->value;
}
RefPtr<MenuBar> menubar;
RefPtr<Menubar> menubar;
if (message.menubar_id() != -1) {
auto it = m_menubars.find(message.menubar_id());
if (it == m_menubars.end()) {

View file

@ -44,7 +44,7 @@ namespace WindowServer {
class Compositor;
class Window;
class Menu;
class MenuBar;
class Menubar;
class ClientConnection final
: public IPC::ClientConnection<WindowClientEndpoint, WindowServerEndpoint>
@ -175,7 +175,7 @@ private:
Window* window_from_id(i32 window_id);
HashMap<int, NonnullRefPtr<Window>> m_windows;
HashMap<int, NonnullRefPtr<MenuBar>> m_menubars;
HashMap<int, NonnullRefPtr<Menubar>> m_menubars;
HashMap<int, NonnullRefPtr<Menu>> m_menus;
RefPtr<Core::Timer> m_ping_timer;

View file

@ -41,7 +41,7 @@
namespace WindowServer {
class ClientConnection;
class MenuBar;
class Menubar;
class Menu final : public Core::Object {
C_OBJECT(Menu);

View file

@ -27,7 +27,7 @@
#pragma once
#include "Menu.h"
#include "MenuBar.h"
#include "Menubar.h"
#include "Window.h"
#include <AK/HashMap.h>
#include <AK/StringBuilder.h>

View file

@ -24,22 +24,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "MenuBar.h"
#include "Menubar.h"
#include "Menu.h"
namespace WindowServer {
MenuBar::MenuBar(ClientConnection& client, int menubar_id)
Menubar::Menubar(ClientConnection& client, int menubar_id)
: m_client(client)
, m_menubar_id(menubar_id)
{
}
MenuBar::~MenuBar()
Menubar::~Menubar()
{
}
void MenuBar::add_menu(Menu& menu)
void Menubar::add_menu(Menu& menu)
{
m_menus.append(&menu);
}

View file

@ -33,12 +33,12 @@
namespace WindowServer {
class MenuBar
: public RefCounted<MenuBar>
, public Weakable<MenuBar> {
class Menubar
: public RefCounted<Menubar>
, public Weakable<Menubar> {
public:
static NonnullRefPtr<MenuBar> create(ClientConnection& client, int menubar_id) { return adopt(*new MenuBar(client, menubar_id)); }
~MenuBar();
static NonnullRefPtr<Menubar> create(ClientConnection& client, int menubar_id) { return adopt(*new Menubar(client, menubar_id)); }
~Menubar();
ClientConnection& client() { return m_client; }
const ClientConnection& client() const { return m_client; }
@ -55,7 +55,7 @@ public:
}
private:
MenuBar(ClientConnection&, int menubar_id);
Menubar(ClientConnection&, int menubar_id);
ClientConnection& m_client;
int m_menubar_id { 0 };

View file

@ -977,7 +977,7 @@ bool Window::hit_test(const Gfx::IntPoint& point, bool include_frame) const
return color.alpha() >= threshold;
}
void Window::set_menubar(MenuBar* menubar)
void Window::set_menubar(Menubar* menubar)
{
if (m_menubar == menubar)
return;

View file

@ -43,7 +43,7 @@ class ClientConnection;
class Cursor;
class KeyEvent;
class Menu;
class MenuBar;
class Menubar;
class MenuItem;
class MouseEvent;
@ -333,9 +333,9 @@ public:
Gfx::DisjointRectSet& transparency_rects() { return m_transparency_rects; }
Gfx::DisjointRectSet& transparency_wallpaper_rects() { return m_transparency_wallpaper_rects; }
MenuBar* menubar() { return m_menubar; }
const MenuBar* menubar() const { return m_menubar; }
void set_menubar(MenuBar*);
Menubar* menubar() { return m_menubar; }
const Menubar* menubar() const { return m_menubar; }
void set_menubar(Menubar*);
private:
virtual void event(Core::Event&) override;
@ -354,7 +354,7 @@ private:
Vector<WeakPtr<Window>> m_child_windows;
Vector<WeakPtr<Window>> m_accessory_windows;
RefPtr<MenuBar> m_menubar;
RefPtr<Menubar> m_menubar;
String m_title;
Gfx::IntRect m_rect;

View file

@ -65,12 +65,12 @@ static int s_last_title_button_icons_scale;
static Gfx::Bitmap* s_active_window_shadow;
static Gfx::Bitmap* s_inactive_window_shadow;
static Gfx::Bitmap* s_menu_shadow;
static Gfx::Bitmap* s_task_bar_shadow;
static Gfx::Bitmap* s_taskbar_shadow;
static Gfx::Bitmap* s_tooltip_shadow;
static String s_last_active_window_shadow_path;
static String s_last_inactive_window_shadow_path;
static String s_last_menu_shadow_path;
static String s_last_task_bar_shadow_path;
static String s_last_taskbar_shadow_path;
static String s_last_tooltip_shadow_path;
static Gfx::IntRect frame_rect_for_window(Window& window, const Gfx::IntRect& rect)
@ -195,7 +195,7 @@ void WindowFrame::reload_config()
load_shadow(WindowManager::the().palette().active_window_shadow_path(), s_last_active_window_shadow_path, s_active_window_shadow);
load_shadow(WindowManager::the().palette().inactive_window_shadow_path(), s_last_inactive_window_shadow_path, s_inactive_window_shadow);
load_shadow(WindowManager::the().palette().menu_shadow_path(), s_last_menu_shadow_path, s_menu_shadow);
load_shadow(WindowManager::the().palette().task_bar_shadow_path(), s_last_task_bar_shadow_path, s_task_bar_shadow);
load_shadow(WindowManager::the().palette().taskbar_shadow_path(), s_last_taskbar_shadow_path, s_taskbar_shadow);
load_shadow(WindowManager::the().palette().tooltip_shadow_path(), s_last_tooltip_shadow_path, s_tooltip_shadow);
}
@ -211,7 +211,7 @@ Gfx::Bitmap* WindowFrame::window_shadow() const
case WindowType::Tooltip:
return s_tooltip_shadow;
case WindowType::Taskbar:
return s_task_bar_shadow;
return s_taskbar_shadow;
case WindowType::AppletArea:
return nullptr;
default:
@ -315,7 +315,7 @@ void WindowFrame::paint_menubar(Gfx::Painter& painter)
bool paint_as_pressed = MenuManager::the().is_open(menu);
bool paint_as_hovered = !paint_as_pressed && &menu == MenuManager::the().hovered_menu();
if (paint_as_pressed || paint_as_hovered) {
Gfx::StylePainter::paint_button(painter, menu.rect_in_window_menubar(), palette, Gfx::ButtonStyle::CoolBar, paint_as_pressed, paint_as_hovered);
Gfx::StylePainter::paint_button(painter, menu.rect_in_window_menubar(), palette, Gfx::ButtonStyle::Coolbar, paint_as_pressed, paint_as_hovered);
}
painter.draw_ui_text(text_rect, menu.name(), font, Gfx::TextAlignment::Center, text_color);
return IterationDecision::Continue;

View file

@ -28,8 +28,8 @@
#include "Compositor.h"
#include "EventLoop.h"
#include "Menu.h"
#include "MenuBar.h"
#include "MenuItem.h"
#include "Menubar.h"
#include "Screen.h"
#include "Window.h"
#include <AK/StdLibExtras.h>

View file

@ -39,8 +39,8 @@
#include <LibGfx/Rect.h>
#include <WindowServer/Cursor.h>
#include <WindowServer/Event.h>
#include <WindowServer/MenuBar.h>
#include <WindowServer/MenuManager.h>
#include <WindowServer/Menubar.h>
#include <WindowServer/Window.h>
#include <WindowServer/WindowSwitcher.h>
#include <WindowServer/WindowType.h>

View file

@ -192,7 +192,7 @@ void WindowSwitcher::draw()
rect_text_color = palette.threed_shadow1();
} else {
if (static_cast<int>(index) == m_hovered_index)
Gfx::StylePainter::paint_button(painter, item_rect, palette, Gfx::ButtonStyle::CoolBar, false, true);
Gfx::StylePainter::paint_button(painter, item_rect, palette, Gfx::ButtonStyle::Coolbar, false, true);
text_color = palette.window_text();
rect_text_color = palette.threed_shadow2();
}