mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
Terminal: Modernize terminal settings as a standalone application
The settings for Terminal are extracted into their own application, TerminalSettings, which is reachable over the normal Settings menu as well as the same place in the Terminal menu. The font settings are moved into these settings as well, which are now split up into the "Terminal" and "View" tabs. The font settings themselves receive an option to override the selected font with the system default on the user side. The live update behavior of all of the terminal settings is retained. The layout of the new TerminalSettings is based around the other Settings applications, but pixel-perfectness is missing in some places. It's a bit fiddly and I'd like to have some better GUI::Label auto-size behavior, but oh well :^)
This commit is contained in:
parent
12468e036b
commit
1ff48a3ca4
11 changed files with 546 additions and 193 deletions
59
Userland/Applications/TerminalSettings/main.cpp
Normal file
59
Userland/Applications/TerminalSettings/main.cpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "TerminalSettingsWidget.h"
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/SettingsWindow.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
|
||||
// Including this after to avoid LibIPC errors
|
||||
#include <LibConfig/Client.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio rpath cpath wpath recvfd sendfd unix proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
Config::pledge_domains("Terminal");
|
||||
|
||||
if (pledge("stdio rpath cpath wpath recvfd sendfd proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/bin/keymap", "x") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/proc/keymap", "r") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil(nullptr, nullptr)) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-terminal");
|
||||
|
||||
auto window = GUI::SettingsWindow::construct("Terminal Settings");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
window->add_tab<TerminalSettingsMainWidget>("Terminal");
|
||||
window->add_tab<TerminalSettingsViewWidget>("View");
|
||||
|
||||
window->show();
|
||||
return app->exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue