mirror of
https://github.com/uowuo/abaddon.git
synced 2026-08-15 05:19:58 +00:00
add auto-refresh for main.css
This commit is contained in:
@@ -255,6 +255,8 @@ int Abaddon::StartGTK() {
|
||||
m_main_window->GetChatWindow()->signal_action_reaction_remove().connect(sigc::mem_fun(*this, &Abaddon::ActionReactionRemove));
|
||||
|
||||
ActionReloadCSS();
|
||||
AttachCSSMonitor();
|
||||
|
||||
if (m_settings.GetSettings().HideToTray) {
|
||||
m_tray = Gtk::StatusIcon::create("discord");
|
||||
m_tray->signal_activate().connect(sigc::mem_fun(*this, &Abaddon::on_tray_click));
|
||||
@@ -627,6 +629,15 @@ void Abaddon::LoadState() {
|
||||
}
|
||||
}
|
||||
|
||||
void Abaddon::AttachCSSMonitor() {
|
||||
const auto path = GetCSSPath("/" + GetSettings().MainCSS);
|
||||
const auto file = Gio::File::create_for_path(path);
|
||||
m_main_css_monitor = file->monitor_file();
|
||||
m_main_css_monitor->signal_changed().connect([this](const auto &file, const auto &other_file, Gio::FileMonitorEvent event) {
|
||||
ActionReloadCSS();
|
||||
});
|
||||
}
|
||||
|
||||
void Abaddon::ManageHeapWindow(Gtk::Window *window) {
|
||||
window->signal_hide().connect([this, window]() {
|
||||
delete window;
|
||||
|
||||
Reference in New Issue
Block a user