diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-12-21 02:10:45 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-12-21 02:10:45 +0100 |
commit | ec1c487dcd7de331d17d9c9ccc21dfbfa00dd4c8 (patch) | |
tree | 797d0ec90846ece3c658d55f1507585c85d0b91f /Widgets | |
parent | 89040cdc99d56e0a1a80b972db18d231c155ace0 (diff) | |
download | serenity-ec1c487dcd7de331d17d9c9ccc21dfbfa00dd4c8.zip |
Yet another pass of style fixes.
Diffstat (limited to 'Widgets')
-rw-r--r-- | Widgets/Button.cpp | 2 | ||||
-rw-r--r-- | Widgets/CheckBox.cpp | 2 | ||||
-rw-r--r-- | Widgets/EventLoop.cpp | 2 | ||||
-rw-r--r-- | Widgets/Label.cpp | 2 | ||||
-rw-r--r-- | Widgets/Rect.h | 2 | ||||
-rw-r--r-- | Widgets/Size.h | 2 | ||||
-rw-r--r-- | Widgets/TerminalWidget.cpp | 2 | ||||
-rw-r--r-- | Widgets/TextBox.cpp | 6 | ||||
-rw-r--r-- | Widgets/Window.cpp | 2 | ||||
-rw-r--r-- | Widgets/WindowManager.cpp | 6 |
10 files changed, 14 insertions, 14 deletions
diff --git a/Widgets/Button.cpp b/Widgets/Button.cpp index 10ec97aa50..5429ad8854 100644 --- a/Widgets/Button.cpp +++ b/Widgets/Button.cpp @@ -61,7 +61,7 @@ void Button::paintEvent(PaintEvent&) painter.drawLine({ 2, height() - 3 }, { width() - 2, height() - 3 }, shadowColor); } - if (!caption().isEmpty()) { + if (!caption().is_empty()) { auto textRect = rect(); if (m_beingPressed) textRect.moveBy(1, 1); diff --git a/Widgets/CheckBox.cpp b/Widgets/CheckBox.cpp index 0a2a34a24e..6fb7f766e1 100644 --- a/Widgets/CheckBox.cpp +++ b/Widgets/CheckBox.cpp @@ -89,7 +89,7 @@ void CheckBox::paintEvent(PaintEvent&) painter.fillRect(rect(), backgroundColor()); painter.drawBitmap(bitmapPosition, *bitmap, foregroundColor()); - if (!caption().isEmpty()) { + if (!caption().is_empty()) { painter.drawText(textRect, caption(), Painter::TextAlignment::TopLeft, foregroundColor()); } } diff --git a/Widgets/EventLoop.cpp b/Widgets/EventLoop.cpp index c396c14903..5c4d5b7ec7 100644 --- a/Widgets/EventLoop.cpp +++ b/Widgets/EventLoop.cpp @@ -23,7 +23,7 @@ EventLoop& EventLoop::main() int EventLoop::exec() { for (;;) { - if (m_queuedEvents.isEmpty()) + if (m_queuedEvents.is_empty()) waitForEvent(); auto events = std::move(m_queuedEvents); for (auto& queuedEvent : events) { diff --git a/Widgets/Label.cpp b/Widgets/Label.cpp index 98937d62a1..7e33147d0c 100644 --- a/Widgets/Label.cpp +++ b/Widgets/Label.cpp @@ -23,7 +23,7 @@ void Label::paintEvent(PaintEvent&) { Painter painter(*this); painter.fillRect({ 0, 0, width(), height() }, backgroundColor()); - if (!text().isEmpty()) + if (!text().is_empty()) painter.drawText({ 4, 4, width(), height() }, text(), Painter::TextAlignment::TopLeft, foregroundColor()); } diff --git a/Widgets/Rect.h b/Widgets/Rect.h index fe954c524c..cd3fbc5411 100644 --- a/Widgets/Rect.h +++ b/Widgets/Rect.h @@ -12,7 +12,7 @@ public: { } - bool isEmpty() const + bool is_empty() const { return width() == 0 || height() == 0; } diff --git a/Widgets/Size.h b/Widgets/Size.h index a50e7b3086..9a86829639 100644 --- a/Widgets/Size.h +++ b/Widgets/Size.h @@ -5,7 +5,7 @@ public: Size() { } Size(int w, int h) : m_width(w), m_height(h) { } - bool isEmpty() const { return !m_width || !m_height; } + bool is_empty() const { return !m_width || !m_height; } int width() const { return m_width; } int height() const { return m_height; } diff --git a/Widgets/TerminalWidget.cpp b/Widgets/TerminalWidget.cpp index 51544ab37a..02f3187aa1 100644 --- a/Widgets/TerminalWidget.cpp +++ b/Widgets/TerminalWidget.cpp @@ -148,7 +148,7 @@ void TerminalWidget::onReceive(byte ch) void TerminalWidget::keyDownEvent(KeyEvent& event) { - if (event.text().isEmpty()) + if (event.text().is_empty()) return; write(g_fd, event.text().characters(), event.text().length()); } diff --git a/Widgets/TextBox.cpp b/Widgets/TextBox.cpp index 291ff83175..075812cb62 100644 --- a/Widgets/TextBox.cpp +++ b/Widgets/TextBox.cpp @@ -78,7 +78,7 @@ void TextBox::handleBackspace() } char* buffer; - auto newText = StringImpl::createUninitialized(m_text.length() - 1, buffer); + auto newText = StringImpl::create_uninitialized(m_text.length() - 1, buffer); memcpy(buffer, m_text.characters(), m_cursorPosition - 1); memcpy(buffer + m_cursorPosition - 1, m_text.characters() + m_cursorPosition, m_text.length() - (m_cursorPosition - 1)); @@ -111,11 +111,11 @@ void TextBox::keyDownEvent(KeyEvent& event) return; } - if (!event.text().isEmpty()) { + if (!event.text().is_empty()) { ASSERT(event.text().length() == 1); char* buffer; - auto newText = StringImpl::createUninitialized(m_text.length() + 1, buffer); + auto newText = StringImpl::create_uninitialized(m_text.length() + 1, buffer); memcpy(buffer, m_text.characters(), m_cursorPosition); buffer[m_cursorPosition] = event.text()[0]; diff --git a/Widgets/Window.cpp b/Widgets/Window.cpp index 7c1e30ef83..2aa53b4b1d 100644 --- a/Widgets/Window.cpp +++ b/Widgets/Window.cpp @@ -78,7 +78,7 @@ void Window::event(Event& event) return; } if (m_mainWidget) { - if (pe.rect().isEmpty()) + if (pe.rect().is_empty()) return m_mainWidget->event(*make<PaintEvent>(m_mainWidget->rect())); else return m_mainWidget->event(event); diff --git a/Widgets/WindowManager.cpp b/Widgets/WindowManager.cpp index c2d32ef7f0..f91983b129 100644 --- a/Widgets/WindowManager.cpp +++ b/Widgets/WindowManager.cpp @@ -94,7 +94,7 @@ void WindowManager::paintWindowFrame(Window& window) }; - if (!m_lastDragRect.isEmpty()) { + if (!m_lastDragRect.is_empty()) { p.xorRect(m_lastDragRect, Color::Red); m_lastDragRect = Rect(); } @@ -137,7 +137,7 @@ void WindowManager::removeWindow(Window& window) return; m_windows.remove(&window); - if (!activeWindow() && !m_windows.isEmpty()) + if (!activeWindow() && !m_windows.is_empty()) setActiveWindow(*m_windows.begin()); repaint(); @@ -245,7 +245,7 @@ void WindowManager::processMouseEvent(MouseEvent& event) void WindowManager::handlePaintEvent(PaintEvent& event) { //printf("[WM] paint event\n"); - if (event.rect().isEmpty()) { + if (event.rect().is_empty()) { event.m_rect.setWidth(AbstractScreen::the().width()); event.m_rect.setHeight(AbstractScreen::the().height()); } |