1 Commits

Author SHA1 Message Date
4c25322757 Show text-event usage tooltips for colors 2026-07-06 09:06:59 -06:00
4 changed files with 168 additions and 172 deletions

View File

@@ -1777,7 +1777,7 @@ text_color_event_list (int color)
{
if (line_len + name_len + 2 > 76)
{
g_string_append (events, ",\n");
g_string_append_c (events, '\n');
line_len = 0;
}
else

File diff suppressed because it is too large Load Diff

View File

@@ -3388,19 +3388,10 @@ mg_topicbar_update_height (GtkWidget *topic)
if (parent && GTK_IS_SCROLLED_WINDOW (parent))
{
GtkScrolledWindow *scrolled = GTK_SCROLLED_WINDOW (parent);
int max_height = gtk_scrolled_window_get_max_content_height (scrolled);
if (max_height != -1 && target_height > max_height)
{
gtk_scrolled_window_set_max_content_height (scrolled, target_height);
gtk_scrolled_window_set_min_content_height (scrolled, target_height);
}
else
{
gtk_scrolled_window_set_min_content_height (scrolled, target_height);
gtk_scrolled_window_set_max_content_height (scrolled, target_height);
}
gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (parent), -1);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (parent), -1);
gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (parent), target_height);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (parent), target_height);
gtk_widget_set_size_request (parent, -1, target_height);
}
}

View File

@@ -52,13 +52,14 @@ static const guint8 theme_default_99_mirc_colors[THEME_XTEXT_MIRC_COLS][3] = {
};
static void
theme_access_apply_default_99_palette (XTextColor *palette, size_t palette_len)
theme_access_apply_default_99_palette (XTextColor *palette, size_t palette_len, gboolean apply_base)
{
size_t i;
size_t start = apply_base ? 0 : 32;
if (palette_len == 0)
return;
for (i = 32; i < THEME_XTEXT_MIRC_COLS && i < palette_len; i++)
for (i = start; i < THEME_XTEXT_MIRC_COLS && i < palette_len; i++)
{
palette[i].red = theme_default_99_mirc_colors[i][0] / 255.0;
palette[i].green = theme_default_99_mirc_colors[i][1] / 255.0;
@@ -147,10 +148,11 @@ gboolean
theme_get_mirc_color (unsigned int mirc_index, GdkRGBA *out_rgba)
{
ThemeSemanticToken token = (ThemeSemanticToken) (THEME_TOKEN_MIRC_0 + (int) mirc_index);
gboolean has_user_colors = theme_runtime_mode_has_user_colors (theme_runtime_is_dark_active ());
if (mirc_index >= THEME_XTEXT_MIRC_COLS)
return FALSE;
if (mirc_index >= 32)
if (!has_user_colors || mirc_index >= 32)
{
out_rgba->red = theme_default_99_mirc_colors[mirc_index][0] / 255.0;
out_rgba->green = theme_default_99_mirc_colors[mirc_index][1] / 255.0;
@@ -171,10 +173,11 @@ gboolean
theme_get_mirc_color_rgb16 (unsigned int mirc_index, guint16 *red, guint16 *green, guint16 *blue)
{
ThemeSemanticToken token = (ThemeSemanticToken) (THEME_TOKEN_MIRC_0 + (int) mirc_index);
gboolean has_user_colors = theme_runtime_mode_has_user_colors (theme_runtime_is_dark_active ());
if (mirc_index >= THEME_XTEXT_MIRC_COLS)
return FALSE;
if (mirc_index >= 32)
if (!has_user_colors || mirc_index >= 32)
{
*red = (guint16) (theme_default_99_mirc_colors[mirc_index][0] * 257);
*green = (guint16) (theme_default_99_mirc_colors[mirc_index][1] * 257);
@@ -224,6 +227,7 @@ void
theme_get_xtext_colors_for_widget (GtkWidget *widget, XTextColor *palette, size_t palette_len)
{
ThemeWidgetStyleValues style_values;
gboolean has_user_colors;
GdkRGBA marker_color;
if (!palette)
@@ -231,8 +235,9 @@ theme_get_xtext_colors_for_widget (GtkWidget *widget, XTextColor *palette, size_
theme_get_widget_style_values_for_widget (widget, &style_values);
theme_runtime_get_xtext_colors (palette, palette_len);
has_user_colors = theme_runtime_mode_has_user_colors (theme_runtime_is_dark_active ());
if (palette_len >= THEME_XTEXT_MIRC_COLS)
theme_access_apply_default_99_palette (palette, palette_len);
theme_access_apply_default_99_palette (palette, palette_len, !has_user_colors);
if (palette_len > THEME_XTEXT_MARK_FG_INDEX)
{
palette[THEME_XTEXT_MARK_FG_INDEX].red = style_values.selection_foreground.red;