mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:47:35 +00:00
IRC client setttings, Terminal settings, more WM settings
This commit is contained in:
parent
63486b8438
commit
e3f81bce49
13 changed files with 89 additions and 53 deletions
|
@ -77,7 +77,8 @@ void WSCompositor::compose()
|
|||
if (wm.any_opaque_window_contains_rect(dirty_rect))
|
||||
continue;
|
||||
m_back_painter->fill_rect(dirty_rect, wm.m_background_color);
|
||||
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
|
||||
if (m_wallpaper)
|
||||
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
|
||||
}
|
||||
|
||||
auto compose_window = [&] (WSWindow& window) -> IterationDecision {
|
||||
|
|
|
@ -38,10 +38,9 @@ WSWindowManager::WSWindowManager()
|
|||
{
|
||||
s_the = this;
|
||||
|
||||
|
||||
m_username = getlogin();
|
||||
|
||||
reload_config();
|
||||
reload_config(false);
|
||||
|
||||
struct AppMenuItem {
|
||||
const char *binary_name;
|
||||
|
@ -63,13 +62,7 @@ WSWindowManager::WSWindowManager()
|
|||
}
|
||||
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 100, "640x480"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 101, "800x600"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 102, "1024x768"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 103, "1280x720"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 104, "1440x900"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 105, "1920x1080"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 106, "2560x1440"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 100, "Reload WM Config File"));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator));
|
||||
m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 200, "About..."));
|
||||
m_system_menu->on_item_activation = [this, apps] (WSMenuItem& item) {
|
||||
|
@ -82,25 +75,7 @@ WSWindowManager::WSWindowManager()
|
|||
}
|
||||
switch (item.identifier()) {
|
||||
case 100:
|
||||
set_resolution(640, 480);
|
||||
break;
|
||||
case 101:
|
||||
set_resolution(800, 600);
|
||||
break;
|
||||
case 102:
|
||||
set_resolution(1024, 768);
|
||||
break;
|
||||
case 103:
|
||||
set_resolution(1280, 720);
|
||||
break;
|
||||
case 104:
|
||||
set_resolution(1440, 900);
|
||||
break;
|
||||
case 105:
|
||||
set_resolution(1920, 1080);
|
||||
break;
|
||||
case 106:
|
||||
set_resolution(2560, 1440);
|
||||
reload_config(true);
|
||||
break;
|
||||
}
|
||||
if (item.identifier() == 200) {
|
||||
|
@ -137,10 +112,16 @@ WSWindowManager::~WSWindowManager()
|
|||
{
|
||||
}
|
||||
|
||||
void WSWindowManager::reload_config()
|
||||
void WSWindowManager::reload_config(bool set_screen)
|
||||
{
|
||||
m_wm_config = CConfigFile::get_for_app("WindowManager");
|
||||
|
||||
m_double_click_speed = m_wm_config->read_num_entry("Input", "DoubleClickSpeed", 250);
|
||||
|
||||
if (set_screen)
|
||||
set_resolution(m_wm_config->read_num_entry("Screen", "Width", 1920),
|
||||
m_wm_config->read_num_entry("Screen", "Height", 1080));
|
||||
|
||||
m_arrow_cursor = WSCursor::create(*GraphicsBitmap::load_from_file(m_wm_config->read_entry("Cursor", "Arrow", "")), { 2, 2 });
|
||||
m_resize_horizontally_cursor = WSCursor::create(*GraphicsBitmap::load_from_file(m_wm_config->read_entry("Cursor", "ResizeH", "")));
|
||||
m_resize_vertically_cursor = WSCursor::create(*GraphicsBitmap::load_from_file(m_wm_config->read_entry("Cursor", "ResizeV", "")));
|
||||
|
@ -669,7 +650,7 @@ void WSWindowManager::process_event_for_doubleclick(WSWindow& window, WSMouseEve
|
|||
|
||||
// FIXME: It might be a sensible idea to also add a distance travel check.
|
||||
// If the pointer moves too far, it's not a double click.
|
||||
if (elapsed_since_last_click < 250) {
|
||||
if (elapsed_since_last_click < m_double_click_speed) {
|
||||
#if defined(DOUBLECLICK_DEBUG)
|
||||
dbgprintf("Transforming MouseUp to MouseDoubleClick!\n");
|
||||
#endif
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
virtual ~WSWindowManager() override;
|
||||
|
||||
RetainPtr<CConfigFile> wm_config() const { return m_wm_config; }
|
||||
void set_wm_config(Retained<CConfigFile> conf) { m_wm_config = conf; }
|
||||
void reload_config(bool);
|
||||
|
||||
void add_window(WSWindow&);
|
||||
void remove_window(WSWindow&);
|
||||
|
@ -156,8 +156,6 @@ private:
|
|||
void tell_wm_listener_about_window_rect(WSWindow& listener, WSWindow&);
|
||||
void pick_new_active_window();
|
||||
|
||||
void reload_config();
|
||||
|
||||
RetainPtr<WSCursor> m_arrow_cursor;
|
||||
RetainPtr<WSCursor> m_resize_horizontally_cursor;
|
||||
RetainPtr<WSCursor> m_resize_vertically_cursor;
|
||||
|
@ -199,6 +197,7 @@ private:
|
|||
CElapsedTimer m_middle_click_clock;
|
||||
};
|
||||
DoubleClickInfo m_double_click_info;
|
||||
unsigned int m_double_click_speed;
|
||||
|
||||
WeakPtr<WSWindow> m_active_window;
|
||||
WeakPtr<WSWindow> m_hovered_window;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue