GWindow: Cleanup
This commit is contained in:
parent
b635c3db54
commit
770907f90c
Notes:
sideshowbarker
2024-07-19 13:34:29 +09:00
Author: https://github.com/faissaloo Commit: https://github.com/SerenityOS/serenity/commit/770907f90ca Pull-request: https://github.com/SerenityOS/serenity/pull/173 Reviewed-by: https://github.com/awesomekling
2 changed files with 18 additions and 20 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "GEventLoop.h"
|
#include "GEventLoop.h"
|
||||||
#include "GWidget.h"
|
#include "GWidget.h"
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibC/stdio.h>
|
#include <LibC/stdio.h>
|
||||||
#include <LibC/stdlib.h>
|
#include <LibC/stdlib.h>
|
||||||
#include <LibC/unistd.h>
|
#include <LibC/unistd.h>
|
||||||
|
@ -350,7 +351,7 @@ void GWindow::event(CEvent& event)
|
||||||
}
|
}
|
||||||
|
|
||||||
void GWindow::paint_keybinds() {
|
void GWindow::paint_keybinds() {
|
||||||
if (m_keybind_mode) {
|
if (!m_keybind_mode) return;
|
||||||
GPainter painter(*m_main_widget);
|
GPainter painter(*m_main_widget);
|
||||||
|
|
||||||
for (auto& keypair: m_hashed_potential_keybind_widgets) {
|
for (auto& keypair: m_hashed_potential_keybind_widgets) {
|
||||||
|
@ -373,7 +374,6 @@ void GWindow::paint_keybinds() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void GWindow::find_keyboard_selectable() {
|
void GWindow::find_keyboard_selectable() {
|
||||||
Vector<GWidget*> potential_keybind_widgets;
|
Vector<GWidget*> potential_keybind_widgets;
|
||||||
|
|
|
@ -2,14 +2,12 @@
|
||||||
|
|
||||||
#include <AK/AKString.h>
|
#include <AK/AKString.h>
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
#include <AK/StringBuilder.h>
|
|
||||||
#include <AK/WeakPtr.h>
|
#include <AK/WeakPtr.h>
|
||||||
#include <LibCore/CObject.h>
|
#include <LibCore/CObject.h>
|
||||||
#include <LibGUI/GWindowType.h>
|
#include <LibGUI/GWindowType.h>
|
||||||
#include <SharedGraphics/GraphicsBitmap.h>
|
#include <SharedGraphics/GraphicsBitmap.h>
|
||||||
#include <SharedGraphics/Rect.h>
|
#include <SharedGraphics/Rect.h>
|
||||||
|
|
||||||
class GPainter;
|
|
||||||
class GWidget;
|
class GWidget;
|
||||||
class GWMEvent;
|
class GWMEvent;
|
||||||
|
|
||||||
|
@ -168,6 +166,6 @@ private:
|
||||||
bool m_show_titlebar { true };
|
bool m_show_titlebar { true };
|
||||||
bool m_keybind_mode { false };
|
bool m_keybind_mode { false };
|
||||||
String m_entered_keybind;
|
String m_entered_keybind;
|
||||||
size_t m_max_keybind_length;
|
size_t m_max_keybind_length { 0 };
|
||||||
HashMap<String, GWidget*> m_hashed_potential_keybind_widgets;
|
HashMap<String, GWidget*> m_hashed_potential_keybind_widgets;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue