1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 09:13:14 +02:00

core: add weechat.look.theme option and theme_applying guard

Add a new string option "weechat.look.theme" holding the name of the
last theme applied via the upcoming /theme command. It is set
automatically by /theme apply and persisted on disk for /theme info to
display after restart; it is NOT re-applied at startup (the user's
saved color values win to avoid clobbering manual post-apply tweaks).

Amend config_change_color so it skips the gui_color_init_weechat ()
and gui_window_ask_refresh (1) calls when theme_applying is set.
/theme apply will set this flag while iterating overrides so the N
individual option changes do not trigger N redundant screen refreshes;
the apply path then performs a single refresh at the end.
This commit is contained in:
Sébastien Helleu
2026-07-04 14:20:30 +02:00
parent 203b9e255f
commit 06f8dd4cd3
17 changed files with 115 additions and 16 deletions
+1
View File
@@ -18,6 +18,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
### Added
- core: add `themable` flag on configuration options
- core: add option weechat.look.theme
- fset: add filter `t:themable`
- relay/api: add resource `GET /api/scripts`
- relay: add option relay.network.unix_socket_permissions ([#2317](https://github.com/weechat/weechat/issues/2317))
+7 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-05-30 14:01+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: Czech <weechat-dev@nongnu.org>\n"
@@ -5216,6 +5216,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "prefix pro zprávy akcí"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
#, fuzzy
msgid ""
"time format for dates converted to strings and displayed in messages (see "
+7 -1
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:28+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -5919,6 +5919,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "Anzahl an Leerzeichen um Tabulatoren in Nachrichten darzustellen"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -24,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:46+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: Spanish <weechat-dev@nongnu.org>\n"
@@ -5362,6 +5362,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "localización para traducción de mensajes"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
#, fuzzy
msgid ""
"time format for dates converted to strings and displayed in messages (see "
+11 -2
View File
@@ -23,8 +23,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"PO-Revision-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-07-04 14:01+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: French <flashcode@flashtux.org>\n"
"Language: fr\n"
@@ -5800,6 +5800,15 @@ msgid "number of spaces used to display tabs in messages"
msgstr ""
"nombre d'espaces utilisés pour afficher les tabulations dans les messages"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
"nom du dernier thème appliqué avec la commande /theme (défini "
"automatiquement, ne pas changer manuellement); à titre d'information "
"seulement, le thème n'est pas réappliqué au démarrage"
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-03-08 08:59+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: Hungarian <weechat-dev@nongnu.org>\n"
@@ -4906,6 +4906,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "válasz ping üzenetre"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
#, fuzzy
msgid ""
"time format for dates converted to strings and displayed in messages (see "
+7 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-05-30 14:02+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: Italian <weechat-dev@nongnu.org>\n"
@@ -5319,6 +5319,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "locale usato per la traduzione dei messaggi"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-05-30 14:02+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <weechat-dev@nongnu.org>\n"
@@ -5479,6 +5479,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "メッセージに含まれるタブ文字を表示する際に使う空白文字の数"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:55+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <soltys@soltys.info>\n"
@@ -5631,6 +5631,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "liczba spacji używana do wyświetlania tabulacji w wiadomościach"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:48+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <weechat-dev@nongnu.org>\n"
@@ -5508,6 +5508,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "número de espaços usados para apresentar tabulações nas mensagens"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -46,7 +46,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:49+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: Portuguese (Brazil) <weechat-dev@nongnu.org>\n"
@@ -5267,6 +5267,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "prefixo para mensagens de ação"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-03-08 08:59+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: Russian <weechat-dev@nongnu.org>\n"
@@ -4940,6 +4940,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "ответить на ping"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
#, fuzzy
msgid ""
"time format for dates converted to strings and displayed in messages (see "
+7 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:52+0200\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: Serbian <ivan.pesic@gmail.com>\n"
@@ -5607,6 +5607,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "број размака који се користи за приказ табулатора у порукама"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2026-06-28 08:53+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: Turkish <emir_sari@icloud.com>\n"
@@ -5431,6 +5431,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr "iletilerdeki sekmeleri görüntülemek için kullanılan boşluk sayısı"
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+7 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2026-07-04 12:53+0200\n"
"POT-Creation-Date: 2026-07-04 13:59+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4616,6 +4616,12 @@ msgstr ""
msgid "number of spaces used to display tabs in messages"
msgstr ""
msgid ""
"name of the last theme applied with command /theme (set automatically, do "
"not change manually); informational only, the theme is not re-applied at "
"startup"
msgstr ""
msgid ""
"time format for dates converted to strings and displayed in messages (see "
"man strftime for date/time specifiers)"
+11 -1
View File
@@ -50,6 +50,7 @@
#include "core-proxy.h"
#include "core-string.h"
#include "core-sys.h"
#include "core-theme.h"
#include "core-util.h"
#include "core-version.h"
#include "../gui/gui-bar.h"
@@ -222,6 +223,7 @@ struct t_config_option *config_look_separator_horizontal = NULL;
struct t_config_option *config_look_separator_vertical = NULL;
struct t_config_option *config_look_tab_whitespace_char = NULL;
struct t_config_option *config_look_tab_width = NULL;
struct t_config_option *config_look_theme = NULL;
struct t_config_option *config_look_time_format = NULL;
struct t_config_option *config_look_whitespace_char = NULL;
struct t_config_option *config_look_window_auto_zoom = NULL;
@@ -1381,7 +1383,7 @@ config_change_color (const void *pointer, void *data,
(void) data;
(void) option;
if (gui_init_ok)
if (gui_init_ok && !theme_applying)
{
gui_color_init_weechat ();
gui_window_ask_refresh (1);
@@ -4427,6 +4429,14 @@ config_weechat_init_options (void)
NULL, NULL, NULL,
&config_change_tab, NULL, NULL,
NULL, NULL, NULL);
config_look_theme = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"theme", "string",
N_("name of the last theme applied with command /theme "
"(set automatically, do not change manually); informational "
"only, the theme is not re-applied at startup"),
NULL, 0, 0, "", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_time_format = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"time_format", "string",
+1
View File
@@ -277,6 +277,7 @@ extern struct t_config_option *config_look_separator_horizontal;
extern struct t_config_option *config_look_separator_vertical;
extern struct t_config_option *config_look_tab_whitespace_char;
extern struct t_config_option *config_look_tab_width;
extern struct t_config_option *config_look_theme;
extern struct t_config_option *config_look_time_format;
extern struct t_config_option *config_look_whitespace_char;
extern struct t_config_option *config_look_window_auto_zoom;