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

Everywhere: Rename title_bar => titlebar

This commit is contained in:
Andreas Kling 2021-04-18 15:35:57 +02:00
parent 81daca5dd7
commit 12546259ff
9 changed files with 65 additions and 65 deletions

View file

@ -392,7 +392,7 @@ OwnPtr<Messages::WindowServer::SetWindowIconBitmapResponse> ClientConnection::ha
window.set_default_icon();
}
window.frame().invalidate_title_bar();
window.frame().invalidate_titlebar();
WindowManager::the().tell_wms_window_icon_changed(window);
return make<Messages::WindowServer::SetWindowIconBitmapResponse>();
}

View file

@ -142,7 +142,7 @@ void Window::set_title(const String& title)
if (m_title == title)
return;
m_title = title;
frame().invalidate_title_bar();
frame().invalidate_titlebar();
WindowManager::the().notify_title_changed(*this);
}
@ -760,7 +760,7 @@ Gfx::IntRect Window::tiled_rect(WindowTileType tiled) const
VERIFY(tiled != WindowTileType::None);
int frame_width = (m_frame.rect().width() - m_rect.width()) / 2;
int title_bar_height = m_frame.title_bar_rect().height();
int titlebar_height = m_frame.titlebar_rect().height();
int menu_height = WindowManager::the().maximized_window_rect(*this).y();
int max_height = WindowManager::the().maximized_window_rect(*this).height();
@ -779,32 +779,32 @@ Gfx::IntRect Window::tiled_rect(WindowTileType tiled) const
return Gfx::IntRect(0,
menu_height,
Screen::the().width() - frame_width,
(max_height - title_bar_height) / 2 - frame_width);
(max_height - titlebar_height) / 2 - frame_width);
case WindowTileType::Bottom:
return Gfx::IntRect(0,
menu_height + (title_bar_height + max_height) / 2 + frame_width,
menu_height + (titlebar_height + max_height) / 2 + frame_width,
Screen::the().width() - frame_width,
(max_height - title_bar_height) / 2 - frame_width);
(max_height - titlebar_height) / 2 - frame_width);
case WindowTileType::TopLeft:
return Gfx::IntRect(0,
menu_height,
Screen::the().width() / 2 - frame_width,
(max_height - title_bar_height) / 2 - frame_width);
(max_height - titlebar_height) / 2 - frame_width);
case WindowTileType::TopRight:
return Gfx::IntRect(Screen::the().width() / 2 + frame_width,
menu_height,
Screen::the().width() / 2 - frame_width,
(max_height - title_bar_height) / 2 - frame_width);
(max_height - titlebar_height) / 2 - frame_width);
case WindowTileType::BottomLeft:
return Gfx::IntRect(0,
menu_height + (title_bar_height + max_height) / 2 + frame_width,
menu_height + (titlebar_height + max_height) / 2 + frame_width,
Screen::the().width() / 2 - frame_width,
(max_height - title_bar_height) / 2);
(max_height - titlebar_height) / 2);
case WindowTileType::BottomRight:
return Gfx::IntRect(Screen::the().width() / 2 + frame_width,
menu_height + (title_bar_height + max_height) / 2 + frame_width,
menu_height + (titlebar_height + max_height) / 2 + frame_width,
Screen::the().width() / 2 - frame_width,
(max_height - title_bar_height) / 2);
(max_height - titlebar_height) / 2);
default:
VERIFY_NOT_REACHED();
}

View file

@ -243,19 +243,19 @@ Gfx::IntRect WindowFrame::menubar_rect() const
return Gfx::WindowTheme::current().menubar_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette(), menu_row_count());
}
Gfx::IntRect WindowFrame::title_bar_rect() const
Gfx::IntRect WindowFrame::titlebar_rect() const
{
return Gfx::WindowTheme::current().title_bar_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette());
return Gfx::WindowTheme::current().titlebar_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette());
}
Gfx::IntRect WindowFrame::title_bar_icon_rect() const
Gfx::IntRect WindowFrame::titlebar_icon_rect() const
{
return Gfx::WindowTheme::current().title_bar_icon_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette());
return Gfx::WindowTheme::current().titlebar_icon_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette());
}
Gfx::IntRect WindowFrame::title_bar_text_rect() const
Gfx::IntRect WindowFrame::titlebar_text_rect() const
{
return Gfx::WindowTheme::current().title_bar_text_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette());
return Gfx::WindowTheme::current().titlebar_text_rect(to_theme_window_type(m_window.type()), m_window.rect(), WindowManager::the().palette());
}
Gfx::WindowTheme::WindowState WindowFrame::window_state_for_theme() const
@ -539,10 +539,10 @@ Gfx::IntRect WindowFrame::render_rect() const
return inflated_for_shadow(rect());
}
void WindowFrame::invalidate_title_bar()
void WindowFrame::invalidate_titlebar()
{
m_dirty = true;
invalidate(title_bar_rect());
invalidate(titlebar_rect());
}
void WindowFrame::invalidate()
@ -636,7 +636,7 @@ void WindowFrame::on_mouse_event(const MouseEvent& event)
if (m_window.blocking_modal_window())
return;
if (title_bar_icon_rect().contains(event.position())) {
if (titlebar_icon_rect().contains(event.position())) {
if (event.type() == Event::MouseDown && (event.button() == MouseButton::Left || event.button() == MouseButton::Right)) {
// Manually start a potential double click. Since we're opening
// a menu, we will only receive the MouseDown event, so we
@ -650,7 +650,7 @@ void WindowFrame::on_mouse_event(const MouseEvent& event)
auto& wm = WindowManager::the();
wm.start_menu_doubleclick(m_window, event);
m_window.popup_window_menu(title_bar_rect().bottom_left().translated(rect().location()), WindowMenuDefaultAction::Close);
m_window.popup_window_menu(titlebar_rect().bottom_left().translated(rect().location()), WindowMenuDefaultAction::Close);
return;
} else if (event.type() == Event::MouseUp && event.button() == MouseButton::Left) {
// Since the MouseDown event opened a menu, another MouseUp
@ -670,10 +670,10 @@ void WindowFrame::on_mouse_event(const MouseEvent& event)
// This is slightly hackish, but expand the title bar rect by two pixels downwards,
// so that mouse events between the title bar and window contents don't act like
// mouse events on the border.
auto adjusted_title_bar_rect = title_bar_rect();
adjusted_title_bar_rect.set_height(adjusted_title_bar_rect.height() + 2);
auto adjusted_titlebar_rect = titlebar_rect();
adjusted_titlebar_rect.set_height(adjusted_titlebar_rect.height() + 2);
if (adjusted_title_bar_rect.contains(event.position())) {
if (adjusted_titlebar_rect.contains(event.position())) {
wm.clear_resize_candidate();
if (event.type() == Event::MouseDown)
@ -778,7 +778,7 @@ void WindowFrame::start_flash_animation()
if (!m_flash_timer) {
m_flash_timer = Core::Timer::construct(100, [this] {
VERIFY(m_flash_counter);
invalidate_title_bar();
invalidate_titlebar();
if (!--m_flash_counter)
m_flash_timer->stop();
});

View file

@ -54,13 +54,13 @@ public:
void render_to_cache();
void on_mouse_event(const MouseEvent&);
void notify_window_rect_changed(const Gfx::IntRect& old_rect, const Gfx::IntRect& new_rect);
void invalidate_title_bar();
void invalidate_titlebar();
void invalidate(Gfx::IntRect relative_rect);
void invalidate();
Gfx::IntRect title_bar_rect() const;
Gfx::IntRect title_bar_icon_rect() const;
Gfx::IntRect title_bar_text_rect() const;
Gfx::IntRect titlebar_rect() const;
Gfx::IntRect titlebar_icon_rect() const;
Gfx::IntRect titlebar_text_rect() const;
Gfx::IntRect menubar_rect() const;
int menu_row_count() const;

View file

@ -1471,8 +1471,8 @@ Gfx::IntRect WindowManager::maximized_window_rect(const Window& window) const
Gfx::IntRect rect = Screen::the().rect();
// Subtract window title bar (leaving the border)
rect.set_y(rect.y() + window.frame().title_bar_rect().height() + window.frame().menubar_rect().height());
rect.set_height(rect.height() - window.frame().title_bar_rect().height() - window.frame().menubar_rect().height());
rect.set_y(rect.y() + window.frame().titlebar_rect().height() + window.frame().menubar_rect().height());
rect.set_height(rect.height() - window.frame().titlebar_rect().height() - window.frame().menubar_rect().height());
// Subtract taskbar window height if present
const_cast<WindowManager*>(this)->for_each_visible_window_of_type_from_back_to_front(WindowType::Taskbar, [&rect](Window& taskbar_window) {
@ -1578,7 +1578,7 @@ void WindowManager::maximize_windows(Window& window, bool maximized)
Gfx::IntPoint WindowManager::get_recommended_window_position(const Gfx::IntPoint& desired)
{
// FIXME: Find a better source for the width and height to shift by.
Gfx::IntPoint shift(8, Gfx::WindowTheme::current().title_bar_height(Gfx::WindowTheme::WindowType::Normal, palette()) + 10);
Gfx::IntPoint shift(8, Gfx::WindowTheme::current().titlebar_height(Gfx::WindowTheme::WindowType::Normal, palette()) + 10);
// FIXME: Find a better source for this.
int taskbar_height = 28;
@ -1596,7 +1596,7 @@ Gfx::IntPoint WindowManager::get_recommended_window_position(const Gfx::IntPoint
point = overlap_window->position() + shift;
point = { point.x() % Screen::the().width(),
(point.y() >= (Screen::the().height() - taskbar_height))
? Gfx::WindowTheme::current().title_bar_height(Gfx::WindowTheme::WindowType::Normal, palette())
? Gfx::WindowTheme::current().titlebar_height(Gfx::WindowTheme::WindowType::Normal, palette())
: point.y() };
} else {
point = desired;