mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-04-01 10:10:18 +00:00
Compare commits
15 Commits
zoitechat-
...
65707f53b7
| Author | SHA1 | Date | |
|---|---|---|---|
| 65707f53b7 | |||
| 21c73e699b | |||
| 63226a7267 | |||
| fb37810367 | |||
|
|
2b66734fa6 | ||
| 380aae139f | |||
|
|
e4e823c4d6 | ||
| d4b16d5866 | |||
| b9cfd9a9f9 | |||
| 664aa150fb | |||
| aead92d9e4 | |||
|
|
7cc5d14045 | ||
| 33fce2af2a | |||
| d26fbb6e89 | |||
| cd93fe3b0e |
@@ -1,6 +1,28 @@
|
|||||||
ZoiteChat ChangeLog
|
ZoiteChat ChangeLog
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
2.18.0~pre5 (2026-03-22)
|
||||||
|
------------------------
|
||||||
|
- Overhauled preferences/config saving: fully staged and transactional, debounced
|
||||||
|
with flush on close, write failures now surfaced.
|
||||||
|
- Overhauled GTK theme handling: live preview, correct colour reset persistence,
|
||||||
|
proper file:// import paths, consistent menubar CSS.
|
||||||
|
- Fixed GTK entry scroll artifact in the input box.
|
||||||
|
- Hardened tray menu lifetime; fixed stale pointer crash on menu destruction.
|
||||||
|
- Fixed AppIndicator tray init for Wayland/source builds; skip redundant X11
|
||||||
|
tray probe for AppIndicator builds.
|
||||||
|
- Split topic/mode rows in channel bar, tighten spacing, persist userlist column widths.
|
||||||
|
- Preserve saved right-pane size on first layout.
|
||||||
|
- Fixed sounds prefs section.
|
||||||
|
- Fixed chanview tree layout and header alignment; tighten topic URL hit-testing.
|
||||||
|
- Dropped realpath() in favour of GLib-only absolute path build.
|
||||||
|
- Made About dialog links explicit; added GPL licence URL.
|
||||||
|
- Added licence headers to new source files.
|
||||||
|
- Windows installer: fixed VC++ redist URL, added non-plugin download fallback,
|
||||||
|
switched to registry-based runtime detection.
|
||||||
|
- Made libayatana-appindicator a required dep in PKGBUILD.
|
||||||
|
- Cleaned up Meson libperl detection.
|
||||||
|
|
||||||
2.18.0~pre4 (2026-03-15)
|
2.18.0~pre4 (2026-03-15)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,45 @@
|
|||||||
<id>zoitechat.desktop</id>
|
<id>zoitechat.desktop</id>
|
||||||
</provides>
|
</provides>
|
||||||
<releases>
|
<releases>
|
||||||
|
<release date="2026-03-22" version="2.18.0~pre5">
|
||||||
|
<description>
|
||||||
|
<p>Preferences and config saving:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Overhauled preferences/config saving: fully staged and transactional, debounced with flush on close, write failures now surfaced.</li>
|
||||||
|
</ul>
|
||||||
|
<p>GTK theme and UI:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Overhauled GTK theme handling: live preview, correct colour reset persistence, proper <code>file://</code> import paths, consistent menubar CSS.</li>
|
||||||
|
<li>Fixed GTK entry scroll artifact in the input box.</li>
|
||||||
|
<li>Split topic/mode rows in channel bar, tighten spacing, persist userlist column widths.</li>
|
||||||
|
<li>Preserve saved right-pane size on first layout.</li>
|
||||||
|
<li>Fixed sounds prefs section.</li>
|
||||||
|
<li>Fixed chanview tree layout and header alignment; tighten topic URL hit-testing.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Tray:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Hardened tray menu lifetime; fixed stale pointer crash on menu destruction.</li>
|
||||||
|
<li>Fixed AppIndicator tray init for Wayland/source builds; skip redundant X11 tray probe for AppIndicator builds.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Build and packaging:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Dropped <code>realpath()</code> in favour of GLib-only absolute path build.</li>
|
||||||
|
<li>Made About dialog links explicit; added GPL licence URL.</li>
|
||||||
|
<li>Added licence headers to new source files.</li>
|
||||||
|
<li>Windows installer: fixed VC++ redist URL, added non-plugin download fallback, switched to registry-based runtime detection.</li>
|
||||||
|
<li>Made <code>libayatana-appindicator</code> a required dep in PKGBUILD.</li>
|
||||||
|
<li>Cleaned up Meson libperl detection.</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release date="2026-03-22" version="2.18.0~pre5">
|
||||||
|
<description>
|
||||||
|
<p>Version metadata update:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Bumped release version references to <code>2.18.0~pre5</code> across build and packaging files.</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
<release date="2026-03-14" version="2.18.0~pre4">
|
<release date="2026-03-14" version="2.18.0~pre4">
|
||||||
<description>
|
<description>
|
||||||
<p>UI fixes, topic bar improvements, and selection styling updates:</p>
|
<p>UI fixes, topic bar improvements, and selection styling updates:</p>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
project('zoitechat', 'c',
|
project('zoitechat', 'c',
|
||||||
version: '2.18.0~pre4',
|
version: '2.18.0~pre5',
|
||||||
meson_version: '>= 0.55.0',
|
meson_version: '>= 0.55.0',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c17',
|
'c_std=c17',
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ else:
|
|||||||
if not hasattr(sys, 'argv'):
|
if not hasattr(sys, 'argv'):
|
||||||
sys.argv = ['<zoitechat>']
|
sys.argv = ['<zoitechat>']
|
||||||
|
|
||||||
VERSION = b'2.18.0~pre4'
|
VERSION = b'2.18.0~pre5'
|
||||||
PLUGIN_NAME = ffi.new('char[]', b'Python')
|
PLUGIN_NAME = ffi.new('char[]', b'Python')
|
||||||
PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1]))
|
PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1]))
|
||||||
PLUGIN_VERSION = ffi.new('char[]', VERSION)
|
PLUGIN_VERSION = ffi.new('char[]', VERSION)
|
||||||
|
|||||||
2
po/de.po
2
po/de.po
@@ -1325,7 +1325,7 @@ msgstr "%C29*%O$t%C29MOTD übersprungen%O"
|
|||||||
|
|
||||||
#: src/common/textevents.h:277
|
#: src/common/textevents.h:277
|
||||||
msgid "%C23*%O$t%C28$1%C is already in use. Retrying with %C18$2%O..."
|
msgid "%C23*%O$t%C28$1%C is already in use. Retrying with %C18$2%O..."
|
||||||
msgstr "%C23*%O$t%C28$1%C wird bereits verwendet. Erneurter Versuch mit %C18$2%O …"
|
msgstr "%C23*%O$t%C28$1%C wird bereits verwendet. Erneuter Versuch mit %C18$2%O …"
|
||||||
|
|
||||||
#: src/common/textevents.h:280
|
#: src/common/textevents.h:280
|
||||||
msgid "%C23*%O$t%C28$1%C is erroneous. Retrying with %C18$2%O..."
|
msgid "%C23*%O$t%C28$1%C is erroneous. Retrying with %C18$2%O..."
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ For more information on ZoiteChat please read our [documentation](https://docs.z
|
|||||||
<sub>
|
<sub>
|
||||||
X-Chat ("xchat") Copyright (c) 1998-2010 By Peter Zelezny.
|
X-Chat ("xchat") Copyright (c) 1998-2010 By Peter Zelezny.
|
||||||
HexChat ("hexchat") Copyright (c) 2009-2014 By Berke Viktor.
|
HexChat ("hexchat") Copyright (c) 2009-2014 By Berke Viktor.
|
||||||
|
Hexchat ("hexchat") Copyright (c) 2015-2025 By Patrick Griffis.
|
||||||
ZoiteChat ("zoitechat") Copyright (c) 2026 By deepend.
|
ZoiteChat ("zoitechat") Copyright (c) 2026 By deepend.
|
||||||
</sub>
|
</sub>
|
||||||
|
|
||||||
|
|||||||
@@ -411,6 +411,7 @@ const struct prefs vars[] =
|
|||||||
{"gui_chanlist_width_topic", P_OFFINT (hex_gui_chanlist_width_topic), TYPE_INT},
|
{"gui_chanlist_width_topic", P_OFFINT (hex_gui_chanlist_width_topic), TYPE_INT},
|
||||||
{"gui_chanlist_width_users", P_OFFINT (hex_gui_chanlist_width_users), TYPE_INT},
|
{"gui_chanlist_width_users", P_OFFINT (hex_gui_chanlist_width_users), TYPE_INT},
|
||||||
{"gui_compact", P_OFFINT (hex_gui_compact), TYPE_BOOL},
|
{"gui_compact", P_OFFINT (hex_gui_compact), TYPE_BOOL},
|
||||||
|
{"gui_ctrlq_quit", P_OFFINT (hex_gui_ctrlq_quit), TYPE_BOOL},
|
||||||
{"gui_dialog_height", P_OFFINT (hex_gui_dialog_height), TYPE_INT},
|
{"gui_dialog_height", P_OFFINT (hex_gui_dialog_height), TYPE_INT},
|
||||||
{"gui_dialog_left", P_OFFINT (hex_gui_dialog_left), TYPE_INT},
|
{"gui_dialog_left", P_OFFINT (hex_gui_dialog_left), TYPE_INT},
|
||||||
{"gui_dialog_top", P_OFFINT (hex_gui_dialog_top), TYPE_INT},
|
{"gui_dialog_top", P_OFFINT (hex_gui_dialog_top), TYPE_INT},
|
||||||
@@ -765,6 +766,7 @@ load_default_config(void)
|
|||||||
#ifdef HAVE_GTK_MAC
|
#ifdef HAVE_GTK_MAC
|
||||||
prefs.hex_gui_hide_menu = 1;
|
prefs.hex_gui_hide_menu = 1;
|
||||||
#endif
|
#endif
|
||||||
|
prefs.hex_gui_ctrlq_quit = 1;
|
||||||
prefs.hex_gui_input_attr = 1;
|
prefs.hex_gui_input_attr = 1;
|
||||||
prefs.hex_gui_input_icon = 1;
|
prefs.hex_gui_input_icon = 1;
|
||||||
prefs.hex_gui_input_nick = 1;
|
prefs.hex_gui_input_nick = 1;
|
||||||
|
|||||||
217
src/common/url.c
217
src/common/url.c
@@ -35,20 +35,11 @@ GTree *url_btree = NULL;
|
|||||||
static gboolean regex_match (const GRegex *re, const char *word,
|
static gboolean regex_match (const GRegex *re, const char *word,
|
||||||
int *start, int *end);
|
int *start, int *end);
|
||||||
static const GRegex *re_url (void);
|
static const GRegex *re_url (void);
|
||||||
static const GRegex *re_url_no_scheme (void);
|
|
||||||
static const GRegex *re_host (void);
|
|
||||||
static const GRegex *re_host6 (void);
|
|
||||||
static const GRegex *re_email (void);
|
|
||||||
static const GRegex *re_nick (void);
|
static const GRegex *re_nick (void);
|
||||||
static const GRegex *re_channel (void);
|
static const GRegex *re_channel (void);
|
||||||
static const GRegex *re_path (void);
|
|
||||||
static gboolean match_nick (const char *word, int *start, int *end);
|
static gboolean match_nick (const char *word, int *start, int *end);
|
||||||
static gboolean match_channel (const char *word, int *start, int *end);
|
static gboolean match_channel (const char *word, int *start, int *end);
|
||||||
static gboolean match_email (const char *word, int *start, int *end);
|
|
||||||
static gboolean match_url (const char *word, int *start, int *end);
|
static gboolean match_url (const char *word, int *start, int *end);
|
||||||
static gboolean match_host (const char *word, int *start, int *end);
|
|
||||||
static gboolean match_host6 (const char *word, int *start, int *end);
|
|
||||||
static gboolean match_path (const char *word, int *start, int *end);
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
url_free (char *url, void *data)
|
url_free (char *url, void *data)
|
||||||
@@ -191,11 +182,7 @@ url_check_word (const char *word)
|
|||||||
int type;
|
int type;
|
||||||
} m[] = {
|
} m[] = {
|
||||||
{ match_url, WORD_URL },
|
{ match_url, WORD_URL },
|
||||||
{ match_email, WORD_EMAIL },
|
|
||||||
{ match_channel, WORD_CHANNEL },
|
{ match_channel, WORD_CHANNEL },
|
||||||
{ match_host6, WORD_HOST6 },
|
|
||||||
{ match_host, WORD_HOST },
|
|
||||||
{ match_path, WORD_PATH },
|
|
||||||
{ match_nick, WORD_NICK },
|
{ match_nick, WORD_NICK },
|
||||||
{ NULL, 0}
|
{ NULL, 0}
|
||||||
};
|
};
|
||||||
@@ -268,43 +255,10 @@ match_channel (const char *word, int *start, int *end)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
match_email (const char *word, int *start, int *end)
|
|
||||||
{
|
|
||||||
return regex_match (re_email (), word, start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
match_url (const char *word, int *start, int *end)
|
match_url (const char *word, int *start, int *end)
|
||||||
{
|
{
|
||||||
if (regex_match (re_url (), word, start, end))
|
return regex_match (re_url (), word, start, end);
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
return regex_match (re_url_no_scheme (), word, start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
match_host (const char *word, int *start, int *end)
|
|
||||||
{
|
|
||||||
return regex_match (re_host (), word, start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
match_host6 (const char *word, int *start, int *end)
|
|
||||||
{
|
|
||||||
if (!regex_match (re_host6 (), word, start, end))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (word[*start] != '[')
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
match_path (const char *word, int *start, int *end)
|
|
||||||
{
|
|
||||||
return regex_match (re_path (), word, start, end);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List of IRC commands for which contents (and thus possible URLs)
|
/* List of IRC commands for which contents (and thus possible URLs)
|
||||||
@@ -451,34 +405,7 @@ make_re (const char *grist)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* HOST description --- */
|
|
||||||
/* (see miscellaneous above) */
|
|
||||||
static const GRegex *
|
|
||||||
re_host (void)
|
|
||||||
{
|
|
||||||
static GRegex *host_ret;
|
|
||||||
|
|
||||||
if (host_ret) return host_ret;
|
|
||||||
|
|
||||||
host_ret = make_re ("(" "(" HOST_URL PORT ")|(" HOST ")" ")");
|
|
||||||
|
|
||||||
return host_ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const GRegex *
|
|
||||||
re_host6 (void)
|
|
||||||
{
|
|
||||||
static GRegex *host6_ret;
|
|
||||||
|
|
||||||
if (host6_ret) return host6_ret;
|
|
||||||
|
|
||||||
host6_ret = make_re ("(" "(" IPV6ADDR ")|(" "\\[" IPV6ADDR "\\]" PORT ")" ")");
|
|
||||||
|
|
||||||
return host6_ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* URL description --- */
|
/* URL description --- */
|
||||||
#define SCHEME "(%s)"
|
|
||||||
#define LPAR "\\("
|
#define LPAR "\\("
|
||||||
#define RPAR "\\)"
|
#define RPAR "\\)"
|
||||||
#define NOPARENS "[^() \t]*"
|
#define NOPARENS "[^() \t]*"
|
||||||
@@ -489,86 +416,18 @@ re_host6 (void)
|
|||||||
"(" NOPARENS ")" \
|
"(" NOPARENS ")" \
|
||||||
")*" /* Zero or more occurrences of either of these */ \
|
")*" /* Zero or more occurrences of either of these */ \
|
||||||
"(?<![.,?!\\]])" /* Not allowed to end with these */
|
"(?<![.,?!\\]])" /* Not allowed to end with these */
|
||||||
#define USERINFO "([-a-z0-9._~%]+(:[-a-z0-9._~%]*)?@)"
|
|
||||||
|
|
||||||
/* Flags used to describe URIs (RFC 3986)
|
|
||||||
*
|
|
||||||
* Bellow is an example of what the flags match.
|
|
||||||
*
|
|
||||||
* URI_AUTHORITY - http://example.org:80/foo/bar
|
|
||||||
* ^^^^^^^^^^^^^^^^
|
|
||||||
* URI_USERINFO/URI_OPT_USERINFO - http://user@example.org:80/foo/bar
|
|
||||||
* ^^^^^
|
|
||||||
* URI_PATH - http://example.org:80/foo/bar
|
|
||||||
* ^^^^^^^^
|
|
||||||
*/
|
|
||||||
#define URI_AUTHORITY (1 << 0)
|
|
||||||
#define URI_OPT_USERINFO (1 << 1)
|
|
||||||
#define URI_USERINFO (1 << 2)
|
|
||||||
#define URI_PATH (1 << 3)
|
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
const char *scheme; /* scheme name. e.g. http */
|
const char *scheme;
|
||||||
const char *path_sep; /* string that begins the path */
|
|
||||||
int flags; /* see above (flag macros) */
|
|
||||||
} uri[] = {
|
} uri[] = {
|
||||||
{ "irc", "/", URI_PATH },
|
{ "http" },
|
||||||
{ "ircs", "/", URI_PATH },
|
{ "https" },
|
||||||
{ "rtsp", "/", URI_AUTHORITY | URI_PATH },
|
{ "ftp" },
|
||||||
{ "feed", "/", URI_AUTHORITY | URI_PATH },
|
{ "gopher" },
|
||||||
{ "teamspeak", "?", URI_AUTHORITY | URI_PATH },
|
{ "gemini" },
|
||||||
{ "ftp", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
{ NULL }
|
||||||
{ "sftp", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "ftps", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "http", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "https", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "cvs", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "svn", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "git", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "bzr", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "rsync", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "mumble", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "ventrilo", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "xmpp", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "h323", ";", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "imap", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "pop", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "nfs", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "smb", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
|
||||||
{ "gopher", "/", URI_AUTHORITY | URI_PATH },
|
|
||||||
{ "gemini", "/", URI_AUTHORITY | URI_PATH },
|
|
||||||
{ "ssh", "", URI_AUTHORITY | URI_OPT_USERINFO },
|
|
||||||
{ "sip", "", URI_AUTHORITY | URI_USERINFO },
|
|
||||||
{ "sips", "", URI_AUTHORITY | URI_USERINFO },
|
|
||||||
{ "magnet", "?", URI_PATH },
|
|
||||||
{ "mailto", "", URI_PATH },
|
|
||||||
{ "bitcoin", "", URI_PATH },
|
|
||||||
{ "gtalk", "", URI_PATH },
|
|
||||||
{ "steam", "", URI_PATH },
|
|
||||||
{ "file", "/", URI_PATH },
|
|
||||||
{ "callto", "", URI_PATH },
|
|
||||||
{ "skype", "", URI_PATH },
|
|
||||||
{ "geo", "", URI_PATH },
|
|
||||||
{ "spotify", "", URI_PATH },
|
|
||||||
{ "lastfm", "/", URI_PATH },
|
|
||||||
{ "xfire", "", URI_PATH },
|
|
||||||
{ "ts3server", "", URI_PATH },
|
|
||||||
{ NULL, "", 0}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const GRegex *
|
|
||||||
re_url_no_scheme (void)
|
|
||||||
{
|
|
||||||
static GRegex *url_ret = NULL;
|
|
||||||
|
|
||||||
if (url_ret) return url_ret;
|
|
||||||
|
|
||||||
url_ret = make_re ("(" HOST_URL OPT_PORT "/" "(" PATH ")?" ")");
|
|
||||||
|
|
||||||
return url_ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const GRegex *
|
static const GRegex *
|
||||||
re_url (void)
|
re_url (void)
|
||||||
{
|
{
|
||||||
@@ -587,27 +446,9 @@ re_url (void)
|
|||||||
g_string_append (grist_gstr, "|");
|
g_string_append (grist_gstr, "|");
|
||||||
|
|
||||||
g_string_append (grist_gstr, "(");
|
g_string_append (grist_gstr, "(");
|
||||||
g_string_append_printf (grist_gstr, "%s:", uri[i].scheme);
|
g_string_append_printf (grist_gstr, "%s://", uri[i].scheme);
|
||||||
|
g_string_append (grist_gstr, HOST_URL_OPT_TLD OPT_PORT);
|
||||||
if (uri[i].flags & URI_AUTHORITY)
|
g_string_append_printf (grist_gstr, "(/" PATH ")?");
|
||||||
g_string_append (grist_gstr, "//");
|
|
||||||
|
|
||||||
if (uri[i].flags & URI_USERINFO)
|
|
||||||
g_string_append (grist_gstr, USERINFO);
|
|
||||||
else if (uri[i].flags & URI_OPT_USERINFO)
|
|
||||||
g_string_append (grist_gstr, USERINFO "?");
|
|
||||||
|
|
||||||
if (uri[i].flags & URI_AUTHORITY)
|
|
||||||
g_string_append (grist_gstr, HOST_URL_OPT_TLD OPT_PORT);
|
|
||||||
|
|
||||||
if (uri[i].flags & URI_PATH)
|
|
||||||
{
|
|
||||||
char *sep_escaped = g_regex_escape_string (uri[i].path_sep, strlen(uri[i].path_sep));
|
|
||||||
|
|
||||||
g_string_append_printf (grist_gstr, "(" "%s" PATH ")?", sep_escaped);
|
|
||||||
|
|
||||||
g_free (sep_escaped);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_string_append (grist_gstr, ")");
|
g_string_append (grist_gstr, ")");
|
||||||
}
|
}
|
||||||
@@ -620,21 +461,6 @@ re_url (void)
|
|||||||
return url_ret;
|
return url_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EMAIL description --- */
|
|
||||||
#define EMAIL "[a-z0-9][._%+-a-z0-9]+@" "(" HOST_URL ")"
|
|
||||||
|
|
||||||
static const GRegex *
|
|
||||||
re_email (void)
|
|
||||||
{
|
|
||||||
static GRegex *email_ret;
|
|
||||||
|
|
||||||
if (email_ret) return email_ret;
|
|
||||||
|
|
||||||
email_ret = make_re ("(" EMAIL ")");
|
|
||||||
|
|
||||||
return email_ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* NICK description --- */
|
/* NICK description --- */
|
||||||
/* For NICKPRE see before url_check_word() */
|
/* For NICKPRE see before url_check_word() */
|
||||||
#define NICKHYP "-"
|
#define NICKHYP "-"
|
||||||
@@ -680,24 +506,3 @@ re_channel (void)
|
|||||||
|
|
||||||
return channel_ret;
|
return channel_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PATH description --- */
|
|
||||||
#ifdef WIN32
|
|
||||||
/* Windows path can be .\ ..\ or C: D: etc */
|
|
||||||
#define FS_PATH "^(\\.{1,2}\\\\|[a-z]:).*"
|
|
||||||
#else
|
|
||||||
/* Linux path can be / or ./ or ../ etc */
|
|
||||||
#define FS_PATH "^(/|\\./|\\.\\./).*"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const GRegex *
|
|
||||||
re_path (void)
|
|
||||||
{
|
|
||||||
static GRegex *path_ret;
|
|
||||||
|
|
||||||
if (path_ret) return path_ret;
|
|
||||||
|
|
||||||
path_ret = make_re ("(" FS_PATH ")");
|
|
||||||
|
|
||||||
return path_ret;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ struct zoitechatprefs
|
|||||||
unsigned int hex_gui_autoopen_recv;
|
unsigned int hex_gui_autoopen_recv;
|
||||||
unsigned int hex_gui_autoopen_send;
|
unsigned int hex_gui_autoopen_send;
|
||||||
unsigned int hex_gui_compact;
|
unsigned int hex_gui_compact;
|
||||||
|
unsigned int hex_gui_ctrlq_quit;
|
||||||
unsigned int hex_gui_filesize_iec;
|
unsigned int hex_gui_filesize_iec;
|
||||||
unsigned int hex_gui_focus_omitalerts;
|
unsigned int hex_gui_focus_omitalerts;
|
||||||
unsigned int hex_gui_hide_menu;
|
unsigned int hex_gui_hide_menu;
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ typedef struct session_gui
|
|||||||
GtkWidget *shbox, *shentry; /* search bar hbox */
|
GtkWidget *shbox, *shentry; /* search bar hbox */
|
||||||
gulong search_changed_signal; /* hook for search change event so blanking the box doesn't suck */
|
gulong search_changed_signal; /* hook for search change event so blanking the box doesn't suck */
|
||||||
|
|
||||||
#define MENU_ID_NUM 14
|
#define MENU_ID_NUM 15
|
||||||
GtkWidget *menu_item[MENU_ID_NUM+1]; /* some items we may change state of */
|
GtkWidget *menu_item[MENU_ID_NUM+1]; /* some items we may change state of */
|
||||||
|
|
||||||
void *chanview; /* chanview.h */
|
void *chanview; /* chanview.h */
|
||||||
|
|||||||
@@ -4206,7 +4206,7 @@ mg_create_menu (session_gui *gui, GtkWidget *table, int away_state)
|
|||||||
gui->menu_item);
|
gui->menu_item);
|
||||||
gtk_widget_set_hexpand (gui->menu, TRUE);
|
gtk_widget_set_hexpand (gui->menu, TRUE);
|
||||||
gtk_widget_set_vexpand (gui->menu, FALSE);
|
gtk_widget_set_vexpand (gui->menu, FALSE);
|
||||||
gtk_widget_set_halign (gui->menu, GTK_ALIGN_FILL);
|
gtk_widget_set_halign (gui->menu, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (gui->menu, GTK_ALIGN_FILL);
|
gtk_widget_set_valign (gui->menu, GTK_ALIGN_FILL);
|
||||||
gtk_grid_attach (GTK_GRID (table), gui->menu, 0, 0, 3, 1);
|
gtk_grid_attach (GTK_GRID (table), gui->menu, 0, 0, 3, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1802,6 +1802,44 @@ menu_change_layout (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
menu_update_quit_accel (void)
|
||||||
|
{
|
||||||
|
GSList *list;
|
||||||
|
|
||||||
|
list = sess_list;
|
||||||
|
while (list)
|
||||||
|
{
|
||||||
|
session *sess = list->data;
|
||||||
|
session_gui *gui = sess->gui;
|
||||||
|
GtkWidget *item;
|
||||||
|
GtkAccelGroup *accel_group;
|
||||||
|
int enabled;
|
||||||
|
|
||||||
|
list = list->next;
|
||||||
|
if (!gui)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
item = gui->menu_item[MENU_ID_QUIT];
|
||||||
|
if (!item)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
enabled = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "zc-ctrlq-enabled"));
|
||||||
|
if (enabled == (int)prefs.hex_gui_ctrlq_quit)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
accel_group = g_object_get_data (G_OBJECT (item), "zc-quit-accel-group");
|
||||||
|
if (!accel_group)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (prefs.hex_gui_ctrlq_quit)
|
||||||
|
gtk_widget_add_accelerator (item, "activate", accel_group, GDK_KEY_q, STATE_CTRL, GTK_ACCEL_VISIBLE);
|
||||||
|
else
|
||||||
|
gtk_widget_remove_accelerator (item, accel_group, GDK_KEY_q, STATE_CTRL);
|
||||||
|
g_object_set_data (G_OBJECT (item), "zc-ctrlq-enabled", GINT_TO_POINTER (prefs.hex_gui_ctrlq_quit));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
menu_layout_cb (GtkWidget *item, gpointer none)
|
menu_layout_cb (GtkWidget *item, gpointer none)
|
||||||
{
|
{
|
||||||
@@ -1879,25 +1917,46 @@ about_dialog_openurl (GtkAboutDialog *dialog, char *uri, gpointer data)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
about_dialog_button_openurl (GtkButton *button, gpointer data)
|
||||||
|
{
|
||||||
|
fe_open_url ((const char *)data);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
about_dialog_add_links (GtkAboutDialog *dialog)
|
about_dialog_add_links (GtkAboutDialog *dialog)
|
||||||
{
|
{
|
||||||
GtkWidget *content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
GtkWidget *actions = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
|
||||||
GtkWidget *row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
|
GtkWidget *website = gtk_button_new_with_label ("Website");
|
||||||
GtkWidget *website = gtk_link_button_new_with_label ("http://zoitechat.zoite.net", "Website");
|
GtkWidget *license = gtk_button_new_with_label ("License");
|
||||||
GtkWidget *license = gtk_link_button_new_with_label ("https://www.gnu.org/licenses/old-licenses/gpl-2.0.html", "License");
|
|
||||||
gtk_button_set_relief (GTK_BUTTON (website), GTK_RELIEF_NONE);
|
g_signal_connect (G_OBJECT (website), "clicked", G_CALLBACK (about_dialog_button_openurl), "http://zoitechat.zoite.net");
|
||||||
gtk_button_set_relief (GTK_BUTTON (license), GTK_RELIEF_NONE);
|
g_signal_connect (G_OBJECT (license), "clicked", G_CALLBACK (about_dialog_button_openurl), "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html");
|
||||||
gtk_box_pack_start (GTK_BOX (row), website, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (actions), website, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (row), license, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (actions), license, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (content), row, FALSE, FALSE, 0);
|
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (actions), website, TRUE);
|
||||||
gtk_widget_show_all (row);
|
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (actions), license, TRUE);
|
||||||
|
gtk_widget_show_all (actions);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
about_dialog_strip_actions (GtkDialog *dialog)
|
||||||
|
{
|
||||||
|
GtkWidget *area = gtk_dialog_get_action_area (dialog);
|
||||||
|
GList *children = gtk_container_get_children (GTK_CONTAINER (area));
|
||||||
|
GList *node;
|
||||||
|
|
||||||
|
for (node = children; node != NULL; node = node->next)
|
||||||
|
gtk_widget_destroy (GTK_WIDGET (node->data));
|
||||||
|
|
||||||
|
g_list_free (children);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
menu_about (GtkWidget *wid, gpointer sess)
|
menu_about (GtkWidget *wid, gpointer sess)
|
||||||
{
|
{
|
||||||
GtkAboutDialog *dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
|
GtkAboutDialog *dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
|
||||||
|
static const gchar *empty_people[] = { NULL };
|
||||||
theme_manager_attach_window (GTK_WIDGET (dialog));
|
theme_manager_attach_window (GTK_WIDGET (dialog));
|
||||||
char comment[512];
|
char comment[512];
|
||||||
g_snprintf (comment, sizeof(comment), ""
|
g_snprintf (comment, sizeof(comment), ""
|
||||||
@@ -1914,14 +1973,20 @@ menu_about (GtkWidget *wid, gpointer sess)
|
|||||||
|
|
||||||
gtk_about_dialog_set_program_name (dialog, _(DISPLAY_NAME));
|
gtk_about_dialog_set_program_name (dialog, _(DISPLAY_NAME));
|
||||||
gtk_about_dialog_set_version (dialog, PACKAGE_VERSION);
|
gtk_about_dialog_set_version (dialog, PACKAGE_VERSION);
|
||||||
gtk_about_dialog_set_authors (dialog, NULL);
|
gtk_about_dialog_set_authors (dialog, empty_people);
|
||||||
gtk_about_dialog_set_documenters (dialog, NULL);
|
gtk_about_dialog_set_documenters (dialog, empty_people);
|
||||||
gtk_about_dialog_set_artists (dialog, NULL);
|
gtk_about_dialog_set_artists (dialog, empty_people);
|
||||||
gtk_about_dialog_set_translator_credits (dialog, NULL);
|
gtk_about_dialog_set_translator_credits (dialog, "");
|
||||||
|
gtk_about_dialog_set_website (dialog, NULL);
|
||||||
|
gtk_about_dialog_set_website_label (dialog, NULL);
|
||||||
|
gtk_about_dialog_set_license (dialog, NULL);
|
||||||
|
gtk_about_dialog_set_wrap_license (dialog, FALSE);
|
||||||
gtk_about_dialog_set_logo (dialog, pix_zoitechat);
|
gtk_about_dialog_set_logo (dialog, pix_zoitechat);
|
||||||
gtk_about_dialog_set_copyright (dialog, "\302\251 1998-2010 Peter \305\275elezn\303\275\n\302\251 2009-2014 Berke Viktor\n\302\251 2026 deepend");
|
gtk_about_dialog_set_copyright (dialog, "\302\251 1998-2010 Peter \305\275elezn\303\275\n\302\251 2009-2014 Berke Viktor\n\302\251 2015-2025 Patrick Griffis\n\302\251 2026 deepend");
|
||||||
gtk_about_dialog_set_comments (dialog, comment);
|
gtk_about_dialog_set_comments (dialog, comment);
|
||||||
|
about_dialog_strip_actions (GTK_DIALOG (dialog));
|
||||||
about_dialog_add_links (dialog);
|
about_dialog_add_links (dialog);
|
||||||
|
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Close"), GTK_RESPONSE_CLOSE);
|
||||||
|
|
||||||
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent_window));
|
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent_window));
|
||||||
g_signal_connect (G_OBJECT(dialog), "response", G_CALLBACK(about_dialog_close), NULL);
|
g_signal_connect (G_OBJECT(dialog), "response", G_CALLBACK(about_dialog_close), NULL);
|
||||||
@@ -1950,7 +2015,7 @@ static struct mymenu mymenu[] = {
|
|||||||
#define CLOSE_OFFSET (13)
|
#define CLOSE_OFFSET (13)
|
||||||
{0, menu_close, 0, M_MENUITEM, 0, 0, 1},
|
{0, menu_close, 0, M_MENUITEM, 0, 0, 1},
|
||||||
{0, 0, 0, M_SEP, 0, 0, 0},
|
{0, 0, 0, M_SEP, 0, 0, 0},
|
||||||
{N_("_Quit"), menu_quit, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_q}, /* 15 */
|
{N_("_Quit"), menu_quit, 0, M_MENUITEM, MENU_ID_QUIT, 0, 1, GDK_KEY_q}, /* 15 */
|
||||||
|
|
||||||
{N_("_View"), 0, 0, M_NEWMENU, 0, 0, 1},
|
{N_("_View"), 0, 0, M_NEWMENU, 0, 0, 1},
|
||||||
#define MENUBAR_OFFSET (17)
|
#define MENUBAR_OFFSET (17)
|
||||||
@@ -2634,7 +2699,7 @@ menu_create_main (void *accel_group, int bar, int away, int toplevel,
|
|||||||
case M_MENUITEM:
|
case M_MENUITEM:
|
||||||
item = gtk_menu_item_new_with_mnemonic (_(mymenu[i].text));
|
item = gtk_menu_item_new_with_mnemonic (_(mymenu[i].text));
|
||||||
normalitem:
|
normalitem:
|
||||||
if (mymenu[i].key != 0)
|
if (mymenu[i].key != 0 && !(mymenu[i].id == MENU_ID_QUIT && !prefs.hex_gui_ctrlq_quit))
|
||||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||||
mymenu[i].key,
|
mymenu[i].key,
|
||||||
mymenu[i].key == GDK_KEY_F1 ? 0 :
|
mymenu[i].key == GDK_KEY_F1 ? 0 :
|
||||||
@@ -2644,6 +2709,11 @@ normalitem:
|
|||||||
STATE_SHIFT | STATE_CTRL :
|
STATE_SHIFT | STATE_CTRL :
|
||||||
STATE_CTRL,
|
STATE_CTRL,
|
||||||
GTK_ACCEL_VISIBLE);
|
GTK_ACCEL_VISIBLE);
|
||||||
|
if (mymenu[i].id == MENU_ID_QUIT)
|
||||||
|
{
|
||||||
|
g_object_set_data (G_OBJECT (item), "zc-quit-accel-group", accel_group);
|
||||||
|
g_object_set_data (G_OBJECT (item), "zc-ctrlq-enabled", GINT_TO_POINTER (prefs.hex_gui_ctrlq_quit));
|
||||||
|
}
|
||||||
if (mymenu[i].callback)
|
if (mymenu[i].callback)
|
||||||
g_signal_connect (G_OBJECT (item), "activate",
|
g_signal_connect (G_OBJECT (item), "activate",
|
||||||
G_CALLBACK (mymenu[i].callback), 0);
|
G_CALLBACK (mymenu[i].callback), 0);
|
||||||
@@ -2685,9 +2755,11 @@ togitem:
|
|||||||
goto togitem;
|
goto togitem;
|
||||||
|
|
||||||
case M_SEP:
|
case M_SEP:
|
||||||
item = gtk_menu_item_new ();
|
item = gtk_separator_menu_item_new ();
|
||||||
gtk_widget_set_sensitive (item, FALSE);
|
if (submenu)
|
||||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
|
||||||
|
else
|
||||||
|
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||||
gtk_widget_show (item);
|
gtk_widget_show (item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ void menu_create (GtkWidget *menu, GSList *list, char *target, int check_path);
|
|||||||
void menu_bar_toggle (void);
|
void menu_bar_toggle (void);
|
||||||
void menu_add_plugin_items (GtkWidget *menu, char *root, char *target);
|
void menu_add_plugin_items (GtkWidget *menu, char *root, char *target);
|
||||||
void menu_change_layout (void);
|
void menu_change_layout (void);
|
||||||
|
void menu_update_quit_accel (void);
|
||||||
|
|
||||||
void menu_set_away (session_gui *gui, int away);
|
void menu_set_away (session_gui *gui, int away);
|
||||||
void menu_set_fullscreen (session_gui *gui, int fullscreen);
|
void menu_set_fullscreen (session_gui *gui, int fullscreen);
|
||||||
@@ -63,8 +64,9 @@ void menu_set_fullscreen (session_gui *gui, int fullscreen);
|
|||||||
#define MENU_ID_USERMENU 12
|
#define MENU_ID_USERMENU 12
|
||||||
#define MENU_ID_FULLSCREEN 13
|
#define MENU_ID_FULLSCREEN 13
|
||||||
#define MENU_ID_ZOITECHAT 14
|
#define MENU_ID_ZOITECHAT 14
|
||||||
|
#define MENU_ID_QUIT 15
|
||||||
|
|
||||||
#if (MENU_ID_NUM < MENU_ID_ZOITECHAT)
|
#if (MENU_ID_NUM < MENU_ID_QUIT)
|
||||||
#error MENU_ID_NUM is set wrong
|
#error MENU_ID_NUM is set wrong
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -536,6 +536,7 @@ static const setting general_settings[] =
|
|||||||
{ST_TOGGLE, N_("WHOIS on notify"), P_OFFINTNL(hex_notify_whois_online), N_("Sends a /WHOIS when a user comes online in your notify list."), 0, 0},
|
{ST_TOGGLE, N_("WHOIS on notify"), P_OFFINTNL(hex_notify_whois_online), N_("Sends a /WHOIS when a user comes online in your notify list."), 0, 0},
|
||||||
{ST_TOGGLE, N_("Hide join and part messages"), P_OFFINTNL(hex_irc_conf_mode), N_("Hide channel join/part messages by default."), 0, 0},
|
{ST_TOGGLE, N_("Hide join and part messages"), P_OFFINTNL(hex_irc_conf_mode), N_("Hide channel join/part messages by default."), 0, 0},
|
||||||
{ST_TOGGLE, N_("Hide nick change messages"), P_OFFINTNL(hex_irc_hide_nickchange), 0, 0, 0},
|
{ST_TOGGLE, N_("Hide nick change messages"), P_OFFINTNL(hex_irc_hide_nickchange), 0, 0, 0},
|
||||||
|
{ST_TOGGLE, N_("Enable Ctrl+Q to quit"), P_OFFINTNL(hex_gui_ctrlq_quit), 0, 0, 0},
|
||||||
|
|
||||||
{ST_END, 0, 0, 0, 0, 0}
|
{ST_END, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@@ -2070,6 +2071,7 @@ setup_apply_real (const ThemeChangedEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mg_apply_setup ();
|
mg_apply_setup ();
|
||||||
|
menu_update_quit_accel ();
|
||||||
tray_apply_setup ();
|
tray_apply_setup ();
|
||||||
zoitechat_reinit_timers ();
|
zoitechat_reinit_timers ();
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,12 @@ theme_manager_save_preferences (void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
theme_manager_dispatch_changed (ThemeChangedReason reasons)
|
||||||
|
{
|
||||||
|
(void)reasons;
|
||||||
|
}
|
||||||
|
|
||||||
ThemePaletteBehavior
|
ThemePaletteBehavior
|
||||||
theme_manager_get_userlist_palette_behavior (const PangoFontDescription *font_desc)
|
theme_manager_get_userlist_palette_behavior (const PangoFontDescription *font_desc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,16 +26,29 @@
|
|||||||
#include "theme-runtime.h"
|
#include "theme-runtime.h"
|
||||||
#include "theme-gtk3.h"
|
#include "theme-gtk3.h"
|
||||||
#include "../maingui.h"
|
#include "../maingui.h"
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
extern char *theme_css_build_toplevel_classes (void) __attribute__ ((weak));
|
||||||
|
#else
|
||||||
|
extern char *theme_css_build_toplevel_classes (void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static char *
|
||||||
|
theme_application_build_toplevel_css (void)
|
||||||
|
{
|
||||||
|
if (theme_css_build_toplevel_classes)
|
||||||
|
return theme_css_build_toplevel_classes ();
|
||||||
|
|
||||||
|
return g_strdup ("");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
theme_application_apply_windows_theme (gboolean dark)
|
theme_application_apply_toplevel_theme (gboolean dark)
|
||||||
{
|
{
|
||||||
GtkSettings *settings = gtk_settings_get_default ();
|
GtkSettings *settings = gtk_settings_get_default ();
|
||||||
static GtkCssProvider *win_theme_provider = NULL;
|
static GtkCssProvider *theme_provider = NULL;
|
||||||
static gboolean win_theme_provider_installed = FALSE;
|
static gboolean theme_provider_installed = FALSE;
|
||||||
GdkScreen *screen;
|
GdkScreen *screen;
|
||||||
gboolean prefer_dark = dark;
|
gboolean prefer_dark = dark;
|
||||||
char *css;
|
char *css;
|
||||||
@@ -56,33 +69,21 @@ theme_application_apply_windows_theme (gboolean dark)
|
|||||||
if (!screen)
|
if (!screen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (theme_gtk3_is_active ())
|
if (!theme_provider)
|
||||||
{
|
theme_provider = gtk_css_provider_new ();
|
||||||
if (win_theme_provider_installed && win_theme_provider)
|
|
||||||
{
|
|
||||||
gtk_style_context_remove_provider_for_screen (screen,
|
|
||||||
GTK_STYLE_PROVIDER (win_theme_provider));
|
|
||||||
win_theme_provider_installed = FALSE;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!win_theme_provider)
|
css = theme_application_build_toplevel_css ();
|
||||||
win_theme_provider = gtk_css_provider_new ();
|
gtk_css_provider_load_from_data (theme_provider, css, -1, NULL);
|
||||||
|
|
||||||
css = theme_css_build_toplevel_classes ();
|
|
||||||
gtk_css_provider_load_from_data (win_theme_provider, css, -1, NULL);
|
|
||||||
g_free (css);
|
g_free (css);
|
||||||
|
|
||||||
if (!win_theme_provider_installed)
|
if (!theme_provider_installed)
|
||||||
{
|
{
|
||||||
gtk_style_context_add_provider_for_screen (screen,
|
gtk_style_context_add_provider_for_screen (screen,
|
||||||
GTK_STYLE_PROVIDER (win_theme_provider),
|
GTK_STYLE_PROVIDER (theme_provider),
|
||||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
|
||||||
win_theme_provider_installed = TRUE;
|
theme_provider_installed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
theme_application_apply_mode (unsigned int mode, gboolean *palette_changed)
|
theme_application_apply_mode (unsigned int mode, gboolean *palette_changed)
|
||||||
@@ -91,10 +92,7 @@ theme_application_apply_mode (unsigned int mode, gboolean *palette_changed)
|
|||||||
|
|
||||||
theme_runtime_load ();
|
theme_runtime_load ();
|
||||||
dark = theme_runtime_apply_mode (mode, palette_changed);
|
dark = theme_runtime_apply_mode (mode, palette_changed);
|
||||||
|
theme_application_apply_toplevel_theme (dark);
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
theme_application_apply_windows_theme (dark);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
theme_application_reload_input_style ();
|
theme_application_reload_input_style ();
|
||||||
|
|
||||||
|
|||||||
@@ -361,20 +361,22 @@ theme_css_build_toplevel_classes (void)
|
|||||||
"color: #f0f0f0;"
|
"color: #f0f0f0;"
|
||||||
"border-color: #202020;"
|
"border-color: #202020;"
|
||||||
"}"
|
"}"
|
||||||
"window.%s menubar, window.%s menubar:backdrop, window.%s menuitem, window.%s menuitem:backdrop {"
|
"window.%s menubar, window.%s menubar:backdrop, window.%s menubar box, window.%s menubar box:backdrop, window.%s menuitem, window.%s menuitem:backdrop {"
|
||||||
"background-color: #202020;"
|
"background-color: @theme_bg_color;"
|
||||||
"color: #f0f0f0;"
|
"background-image: none;"
|
||||||
"border-color: #202020;"
|
"color: @theme_fg_color;"
|
||||||
|
"border-color: @theme_bg_color;"
|
||||||
"}"
|
"}"
|
||||||
"window.%s, window.%s:backdrop, .%s {"
|
"window.%s, window.%s:backdrop, .%s {"
|
||||||
"background-color: #f6f6f6;"
|
"background-color: #f6f6f6;"
|
||||||
"color: #101010;"
|
"color: #101010;"
|
||||||
"border-color: #f6f6f6;"
|
"border-color: #f6f6f6;"
|
||||||
"}"
|
"}"
|
||||||
"window.%s menubar, window.%s menubar:backdrop, window.%s menuitem, window.%s menuitem:backdrop {"
|
"window.%s menubar, window.%s menubar:backdrop, window.%s menubar box, window.%s menubar box:backdrop, window.%s menuitem, window.%s menuitem:backdrop {"
|
||||||
"background-color: #f6f6f6;"
|
"background-color: @theme_bg_color;"
|
||||||
"color: #101010;"
|
"background-image: none;"
|
||||||
"border-color: #f6f6f6;"
|
"color: @theme_fg_color;"
|
||||||
|
"border-color: @theme_bg_color;"
|
||||||
"}",
|
"}",
|
||||||
theme_css_selector_dark_class,
|
theme_css_selector_dark_class,
|
||||||
theme_css_selector_dark_class,
|
theme_css_selector_dark_class,
|
||||||
@@ -383,6 +385,10 @@ theme_css_build_toplevel_classes (void)
|
|||||||
theme_css_selector_dark_class,
|
theme_css_selector_dark_class,
|
||||||
theme_css_selector_dark_class,
|
theme_css_selector_dark_class,
|
||||||
theme_css_selector_dark_class,
|
theme_css_selector_dark_class,
|
||||||
|
theme_css_selector_dark_class,
|
||||||
|
theme_css_selector_dark_class,
|
||||||
|
theme_css_selector_light_class,
|
||||||
|
theme_css_selector_light_class,
|
||||||
theme_css_selector_light_class,
|
theme_css_selector_light_class,
|
||||||
theme_css_selector_light_class,
|
theme_css_selector_light_class,
|
||||||
theme_css_selector_light_class,
|
theme_css_selector_light_class,
|
||||||
|
|||||||
@@ -216,8 +216,6 @@ theme_manager_queue_auto_refresh (GtkSettings *settings, GParamSpec *pspec, gpoi
|
|||||||
void
|
void
|
||||||
theme_manager_init (void)
|
theme_manager_init (void)
|
||||||
{
|
{
|
||||||
GtkSettings *settings;
|
|
||||||
|
|
||||||
if (!theme_manager_listeners)
|
if (!theme_manager_listeners)
|
||||||
theme_manager_listeners = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL,
|
theme_manager_listeners = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL,
|
||||||
theme_listener_free);
|
theme_listener_free);
|
||||||
@@ -225,21 +223,10 @@ theme_manager_init (void)
|
|||||||
if (!theme_manager_setup_listener_id)
|
if (!theme_manager_setup_listener_id)
|
||||||
theme_manager_setup_listener_id = theme_listener_register ("setup.apply", theme_manager_setup_apply_listener, NULL);
|
theme_manager_setup_listener_id = theme_listener_register ("setup.apply", theme_manager_setup_apply_listener, NULL);
|
||||||
|
|
||||||
settings = gtk_settings_get_default ();
|
fe_set_auto_dark_mode_state (FALSE);
|
||||||
if (settings)
|
|
||||||
fe_set_auto_dark_mode_state (theme_policy_system_prefers_dark ());
|
|
||||||
|
|
||||||
theme_application_apply_mode (prefs.hex_gui_dark_mode, NULL);
|
theme_application_apply_mode (prefs.hex_gui_dark_mode, NULL);
|
||||||
theme_gtk3_init ();
|
theme_gtk3_init ();
|
||||||
zoitechat_set_theme_post_apply_callback (theme_manager_handle_theme_applied);
|
zoitechat_set_theme_post_apply_callback (theme_manager_handle_theme_applied);
|
||||||
|
|
||||||
if (settings)
|
|
||||||
{
|
|
||||||
g_signal_connect (settings, "notify::gtk-application-prefer-dark-theme",
|
|
||||||
G_CALLBACK (theme_manager_queue_auto_refresh), NULL);
|
|
||||||
g_signal_connect (settings, "notify::gtk-theme-name",
|
|
||||||
G_CALLBACK (theme_manager_queue_auto_refresh), NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@@ -494,7 +481,6 @@ theme_manager_apply_wayland_kde_csd (GtkWidget *window)
|
|||||||
static void
|
static void
|
||||||
theme_manager_apply_platform_window_theme (GtkWidget *window)
|
theme_manager_apply_platform_window_theme (GtkWidget *window)
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
gboolean dark;
|
gboolean dark;
|
||||||
|
|
||||||
@@ -516,6 +502,7 @@ theme_manager_apply_platform_window_theme (GtkWidget *window)
|
|||||||
gtk_style_context_remove_class (context, "zoitechat-light");
|
gtk_style_context_remove_class (context, "zoitechat-light");
|
||||||
gtk_style_context_add_class (context, dark ? "zoitechat-dark" : "zoitechat-light");
|
gtk_style_context_add_class (context, dark ? "zoitechat-dark" : "zoitechat-light");
|
||||||
}
|
}
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
fe_win32_apply_native_titlebar (window, dark);
|
fe_win32_apply_native_titlebar (window, dark);
|
||||||
#else
|
#else
|
||||||
theme_manager_apply_wayland_kde_csd (window);
|
theme_manager_apply_wayland_kde_csd (window);
|
||||||
|
|||||||
@@ -27,38 +27,7 @@
|
|||||||
gboolean
|
gboolean
|
||||||
theme_policy_system_prefers_dark (void)
|
theme_policy_system_prefers_dark (void)
|
||||||
{
|
{
|
||||||
GtkSettings *settings = gtk_settings_get_default ();
|
return FALSE;
|
||||||
gboolean prefer_dark = FALSE;
|
|
||||||
char *theme_name = NULL;
|
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
gboolean have_win_pref = FALSE;
|
|
||||||
|
|
||||||
if (fe_win32_high_contrast_is_enabled ())
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
have_win_pref = fe_win32_try_get_system_dark (&prefer_dark);
|
|
||||||
if (!have_win_pref)
|
|
||||||
#endif
|
|
||||||
if (settings && g_object_class_find_property (G_OBJECT_GET_CLASS (settings),
|
|
||||||
"gtk-application-prefer-dark-theme"))
|
|
||||||
{
|
|
||||||
g_object_get (settings, "gtk-application-prefer-dark-theme", &prefer_dark, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings && !prefer_dark)
|
|
||||||
{
|
|
||||||
g_object_get (settings, "gtk-theme-name", &theme_name, NULL);
|
|
||||||
if (theme_name)
|
|
||||||
{
|
|
||||||
char *lower = g_ascii_strdown (theme_name, -1);
|
|
||||||
if (g_str_has_suffix (lower, "-dark") || g_strrstr (lower, "dark"))
|
|
||||||
prefer_dark = TRUE;
|
|
||||||
g_free (lower);
|
|
||||||
g_free (theme_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return prefer_dark;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|||||||
@@ -1350,6 +1350,19 @@ theme_preferences_gtk3_sync_remove_state (theme_preferences_ui *ui)
|
|||||||
gtk_widget_set_sensitive (ui->gtk3_remove, source == ZOITECHAT_GTK3_THEME_SOURCE_USER);
|
gtk_widget_set_sensitive (ui->gtk3_remove, source == ZOITECHAT_GTK3_THEME_SOURCE_USER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
theme_preferences_gtk3_apply_and_refresh (GError **error)
|
||||||
|
{
|
||||||
|
if (!theme_gtk3_apply_current (error))
|
||||||
|
return FALSE;
|
||||||
|
theme_manager_dispatch_changed (THEME_CHANGED_REASON_THEME_PACK |
|
||||||
|
THEME_CHANGED_REASON_PALETTE |
|
||||||
|
THEME_CHANGED_REASON_WIDGET_STYLE |
|
||||||
|
THEME_CHANGED_REASON_USERLIST |
|
||||||
|
THEME_CHANGED_REASON_MODE);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
theme_preferences_gtk3_changed_cb (GtkComboBox *combo, gpointer user_data)
|
theme_preferences_gtk3_changed_cb (GtkComboBox *combo, gpointer user_data)
|
||||||
{
|
{
|
||||||
@@ -1380,7 +1393,7 @@ theme_preferences_gtk3_changed_cb (GtkComboBox *combo, gpointer user_data)
|
|||||||
ui->setup_prefs->hex_gui_gtk3_variant = prefs.hex_gui_gtk3_variant;
|
ui->setup_prefs->hex_gui_gtk3_variant = prefs.hex_gui_gtk3_variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection_changed && !theme_gtk3_apply_current (&error))
|
if (selection_changed && !theme_preferences_gtk3_apply_and_refresh (&error))
|
||||||
{
|
{
|
||||||
theme_preferences_show_message (ui, GTK_MESSAGE_ERROR,
|
theme_preferences_show_message (ui, GTK_MESSAGE_ERROR,
|
||||||
error ? error->message : _("Failed to apply GTK3 theme."));
|
error ? error->message : _("Failed to apply GTK3 theme."));
|
||||||
@@ -1557,7 +1570,7 @@ theme_preferences_populate_gtk3 (theme_preferences_ui *ui)
|
|||||||
g_free (final_id);
|
g_free (final_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (should_apply && !theme_gtk3_apply_current (&error))
|
if (should_apply && !theme_preferences_gtk3_apply_and_refresh (&error))
|
||||||
{
|
{
|
||||||
theme_preferences_show_message (ui, GTK_MESSAGE_ERROR,
|
theme_preferences_show_message (ui, GTK_MESSAGE_ERROR,
|
||||||
error ? error->message : _("Failed to apply GTK3 theme."));
|
error ? error->message : _("Failed to apply GTK3 theme."));
|
||||||
|
|||||||
@@ -44,14 +44,29 @@
|
|||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
COL_PIX=0, /* GdkPixbuf * */
|
COL_PIX=0, /* GdkPixbuf * */
|
||||||
COL_NICK=1, /* char * */
|
COL_PREFIX=1, /* char * */
|
||||||
COL_HOST=2, /* char * */
|
COL_NICK=2, /* char * */
|
||||||
COL_USER=3, /* struct User * */
|
COL_HOST=3, /* char * */
|
||||||
COL_GDKCOLOR=4 /* GdkRGBA */
|
COL_USER=4, /* struct User * */
|
||||||
|
COL_GDKCOLOR=5 /* GdkRGBA */
|
||||||
};
|
};
|
||||||
|
|
||||||
static void userlist_store_color (GtkListStore *store, GtkTreeIter *iter, ThemeSemanticToken token, gboolean has_token);
|
static void userlist_store_color (GtkListStore *store, GtkTreeIter *iter, ThemeSemanticToken token, gboolean has_token);
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
userlist_prefix_color (char prefix)
|
||||||
|
{
|
||||||
|
switch (prefix)
|
||||||
|
{
|
||||||
|
case '~': return "#d46a6a";
|
||||||
|
case '@': return "#5ea36a";
|
||||||
|
case '%': return "#d39a5f";
|
||||||
|
case '&': return "#79aecd";
|
||||||
|
case '+': return "#d2bf6a";
|
||||||
|
default: return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
userlist_column_width_notify_cb (GtkTreeViewColumn *column, GParamSpec *pspec, gpointer userdata)
|
userlist_column_width_notify_cb (GtkTreeViewColumn *column, GParamSpec *pspec, gpointer userdata)
|
||||||
{
|
{
|
||||||
@@ -500,6 +515,11 @@ fe_userlist_insert (session *sess, struct User *newuser, gboolean sel)
|
|||||||
GdkPixbuf *pix = get_user_icon (sess->server, newuser);
|
GdkPixbuf *pix = get_user_icon (sess->server, newuser);
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
char *nick;
|
char *nick;
|
||||||
|
char *nick_escaped;
|
||||||
|
char *prefix = NULL;
|
||||||
|
char *prefix_escaped;
|
||||||
|
char prefix_text[2];
|
||||||
|
const char *prefix_color;
|
||||||
ThemeSemanticToken nick_token = THEME_TOKEN_TEXT_FOREGROUND;
|
ThemeSemanticToken nick_token = THEME_TOKEN_TEXT_FOREGROUND;
|
||||||
gboolean have_nick_token = FALSE;
|
gboolean have_nick_token = FALSE;
|
||||||
|
|
||||||
@@ -519,30 +539,36 @@ fe_userlist_insert (session *sess, struct User *newuser, gboolean sel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nick = newuser->nick;
|
nick_escaped = g_markup_escape_text (newuser->nick, -1);
|
||||||
|
nick = nick_escaped;
|
||||||
if (!prefs.hex_gui_ulist_icons)
|
if (!prefs.hex_gui_ulist_icons)
|
||||||
{
|
{
|
||||||
nick = g_malloc (strlen (newuser->nick) + 2);
|
if (newuser->prefix[0] != '\0' && newuser->prefix[0] != ' ')
|
||||||
nick[0] = newuser->prefix[0];
|
{
|
||||||
if (nick[0] == '\0' || nick[0] == ' ')
|
prefix_text[0] = newuser->prefix[0];
|
||||||
strcpy (nick, newuser->nick);
|
prefix_text[1] = '\0';
|
||||||
else
|
prefix_escaped = g_markup_escape_text (prefix_text, -1);
|
||||||
strcpy (nick + 1, newuser->nick);
|
prefix_color = userlist_prefix_color (newuser->prefix[0]);
|
||||||
|
if (prefix_color)
|
||||||
|
prefix = g_strdup_printf ("<b><span foreground=\"%s\">%s</span></b>", prefix_color, prefix_escaped);
|
||||||
|
else
|
||||||
|
prefix = g_strdup_printf ("<b>%s</b>", prefix_escaped);
|
||||||
|
g_free (prefix_escaped);
|
||||||
|
}
|
||||||
pix = NULL;
|
pix = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, 0,
|
gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, 0,
|
||||||
COL_PIX, pix,
|
COL_PIX, pix,
|
||||||
|
COL_PREFIX, prefix,
|
||||||
COL_NICK, nick,
|
COL_NICK, nick,
|
||||||
COL_HOST, newuser->hostname,
|
COL_HOST, newuser->hostname,
|
||||||
COL_USER, newuser,
|
COL_USER, newuser,
|
||||||
-1);
|
-1);
|
||||||
userlist_store_color (GTK_LIST_STORE (model), &iter, nick_token, have_nick_token);
|
userlist_store_color (GTK_LIST_STORE (model), &iter, nick_token, have_nick_token);
|
||||||
|
|
||||||
if (!prefs.hex_gui_ulist_icons)
|
g_free (prefix);
|
||||||
{
|
g_free (nick_escaped);
|
||||||
g_free (nick);
|
|
||||||
}
|
|
||||||
|
|
||||||
userlist_row_map_set (sess, model, newuser, &iter);
|
userlist_row_map_set (sess, model, newuser, &iter);
|
||||||
|
|
||||||
@@ -671,8 +697,8 @@ userlist_create_model (session *sess)
|
|||||||
GtkTreeIterCompareFunc cmp_func;
|
GtkTreeIterCompareFunc cmp_func;
|
||||||
GtkSortType sort_type;
|
GtkSortType sort_type;
|
||||||
|
|
||||||
store = gtk_list_store_new (5, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
|
store = gtk_list_store_new (6, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
|
||||||
G_TYPE_POINTER, THEME_GTK_COLOR_TYPE);
|
G_TYPE_STRING, G_TYPE_POINTER, THEME_GTK_COLOR_TYPE);
|
||||||
|
|
||||||
switch (prefs.hex_gui_ulist_sort)
|
switch (prefs.hex_gui_ulist_sort)
|
||||||
{
|
{
|
||||||
@@ -717,19 +743,29 @@ userlist_add_columns (GtkTreeView * treeview)
|
|||||||
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
||||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||||
-1, NULL, renderer,
|
-1, NULL, renderer,
|
||||||
"pixbuf", 0, NULL);
|
"pixbuf", COL_PIX, NULL);
|
||||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 0);
|
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 0);
|
||||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||||
|
|
||||||
/* nick column */
|
/* nick column */
|
||||||
|
column = gtk_tree_view_column_new ();
|
||||||
|
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
|
||||||
|
|
||||||
|
renderer = gtk_cell_renderer_text_new ();
|
||||||
|
if (prefs.hex_gui_compact)
|
||||||
|
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
||||||
|
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
||||||
|
gtk_tree_view_column_pack_start (column, renderer, FALSE);
|
||||||
|
gtk_tree_view_column_add_attribute (column, renderer, "markup", COL_PREFIX);
|
||||||
|
|
||||||
renderer = gtk_cell_renderer_text_new ();
|
renderer = gtk_cell_renderer_text_new ();
|
||||||
if (prefs.hex_gui_compact)
|
if (prefs.hex_gui_compact)
|
||||||
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
||||||
g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||||
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
||||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
gtk_tree_view_column_pack_start (column, renderer, TRUE);
|
||||||
-1, NULL, renderer,
|
gtk_tree_view_column_add_attribute (column, renderer, "markup", COL_NICK);
|
||||||
"text", 1, THEME_GTK_FOREGROUND_PROPERTY, 4, NULL);
|
gtk_tree_view_column_add_attribute (column, renderer, THEME_GTK_FOREGROUND_PROPERTY, COL_GDKCOLOR);
|
||||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 1);
|
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 1);
|
||||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||||
gtk_tree_view_column_set_expand (column, TRUE);
|
gtk_tree_view_column_set_expand (column, TRUE);
|
||||||
@@ -750,7 +786,7 @@ userlist_add_columns (GtkTreeView * treeview)
|
|||||||
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
||||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||||
-1, NULL, renderer,
|
-1, NULL, renderer,
|
||||||
"text", 2, NULL);
|
"text", COL_HOST, NULL);
|
||||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 2);
|
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 2);
|
||||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||||
gtk_tree_view_column_set_expand (column, TRUE);
|
gtk_tree_view_column_set_expand (column, TRUE);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.18.0~pre4
|
2.18.0~pre5
|
||||||
|
|||||||
Reference in New Issue
Block a user