pan-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-users] Various possible bug fixes


From: Steve Davies
Subject: Re: [Pan-users] Various possible bug fixes
Date: Thu, 6 Mar 2014 13:08:15 +0000

Many thanks Andrew.

The first of those is one I've wanted for a long time, so I'll endeavour to refresh the Win32 build with it over the next few days :)

Cheers,
Steve




On 5 March 2014 18:25, Andrew Nile <address@hidden> wrote:
Hi! I have been playing around with the Pan source a bit and I think I
have a few fixes for you guys to consider. Please feel free to use any
or none of these. I have never used a mailing list before, so if I do
something wrong, I'm sorry.

Strange colours on first run patch:

--- a/header-pane.cc 2014-02-22 14:13:50 +0000
+++ b/header-pane.cc 2014-03-04 21:49:36 +0000
@@ -1993,8 +1993,8 @@
   _cache (cache),
   _gui (gui),
   _cleared (true),
-  _fg(prefs.get_color_str ("text-color-fg", def_color_fg_str)),
-  _bg(prefs.get_color_str ("text-color-bg", def_color_str))
+  _fg(prefs.get_color_str_wo_fallback ("text-color-fg")),
+  _bg(prefs.get_color_str_wo_fallback ("text-color-bg"))
 {

   // init the icons

This should fix the strange colours that are given to the text on the
first run. This is because def_color_fg_str and def_color_str are
uninitialized variables (assigned on line 66) before Pan actually
init's the default colours.

It's not the best fix :(. Idea 2 was to hard code in black and white
as the fallback string instead. I couldn't get init_colors to go
before the gtk init (which creates the pane first) as it needs the gtk
to find out what the system colour scheme is. But I imagine first time
runs don't happen very often :).

Group prefs dialog colour patch:

--- a/group-prefs-dialog.cc 2014-02-22 14:13:50 +0000
+++ b/group-prefs-dialog.cc 2014-03-05 17:57:12 +0000
@@ -242,14 +242,12 @@
     }
   }

-
   GtkWidget* new_color_button (const Quark& group, Prefs& prefs,
GroupPrefs& gprefs, GroupPrefsDialog* dialog, GtkWidget* w)
   {
-
     const PanColors& colors (PanColors::get());
-    const std::string& bg (colors.def_bg);
-
-    const GdkColor& val (gprefs.get_group_color (group, bg));
+    const std::string& def_fg (colors.def_fg);
+ const std::string& fg (prefs.get_color_str("group-pane-color-fg", def_fg));
+    const GdkColor& val (gprefs.get_group_color (group, fg));
     GtkWidget * b = gtk_color_button_new_with_color (&val);
     g_signal_connect (b, "color-set", G_CALLBACK(color_set_cb), dialog);
     return b;

If you opened the preferences dialog for any group before, it would
suggest a white colour. If you have a white background, it becomes
white on white when closed. I realised it was using Pan's default
background colour as the foreground colour, so I did a quick swap. But
then when trying an inverted colour scheme, I realised it didn't
respect the pane's preferences. So this patch should change the
behaviour to:

- If there's a specific group colour set, use that
- If not, but there's a group pane foreground set, use that
- If none of those, use Pan's default foreground (black).

Newly subscribed groups go to Local Folders patch:

--- a/group-pane.cc 2014-02-22 14:13:50 +0000
+++ b/group-pane.cc 2014-03-05 14:08:58 +0000
@@ -458,7 +458,7 @@
   // find out where it should be moved to
   int pos (0);
   GtkTreeIter section_iter, group_iter;
-  if (gtk_tree_model_iter_nth_child (model, &section_iter, NULL, (sub?0:1))) {
+  if (gtk_tree_model_iter_nth_child (model, &section_iter, NULL, (sub?1:2))) {
     if (gtk_tree_model_iter_children (model, &group_iter, &section_iter)) do {
       MyRow * row (dynamic_cast<MyRow*>(_tree_store->get_row (&group_iter)));
       if (groupname.to_string() < row->groupname.c_str())

This small change (the 0:1 to 1:2) makes subscribed and unsubscribed
threads go to the right places. Before this, they would appear in
Local Folders or get stuck in Subscribed.

"Neaten colour preferences dialog a bit" patch:

--- a/prefs-ui.cc 2014-02-22 14:13:50 +0000
+++ b/prefs-ui.cc 2014-03-04 21:50:48 +0000
@@ -1238,11 +1238,13 @@
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("body-pane-color-quote-bg", def_color_str, prefs));
     HIG :: workarea_add_row (t, &row, _("Quoted text:"), h);
     h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+    pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("body-pane-color-url", TANGO_SKY_BLUE_DARK, prefs));
     pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("body-pane-color-url-bg", def_color_str, prefs)); //
     HIG :: workarea_add_row (t, &row, _("URL:"), h);
     h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+    pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("body-pane-color-signature", TANGO_SKY_BLUE_LIGHT, prefs));
     pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("body-pane-color-signature-bg", def_color_str, prefs)); //
@@ -1252,15 +1254,16 @@
   HIG :: workarea_add_section_divider (t, &row);
   HIG :: workarea_add_section_title (t, &row, _("Other Text"));
     h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+    pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("text-color-fg", def_color_fg_str, prefs));
+    pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("text-color-bg", def_color_str, prefs));
     HIG :: workarea_add_row (t, &row, _("Text Color:"), h);
-  HIG :: workarea_finish (t, &row);
-
   HIG :: workarea_add_section_divider (t, &row);
   HIG :: workarea_add_section_title (t, &row, _("Group Pane"));
     HIG :: workarea_add_section_spacer (t, row, 1);
     h = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, PAD_SMALL);
+    pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Text:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("group-pane-color-fg", def_color_fg_str, prefs));
     pan_box_pack_start_defaults (GTK_BOX(h), gtk_label_new (_("Background:")));
     pan_box_pack_start_defaults (GTK_BOX(h), new_color_button
("group-pane-color-bg", def_color_str, prefs)); //

I was in two minds about this one, but I'll let you guys decide. The
erroneous finish is what makes the group pane colour settings fall
below the rest. Some other labels are added. It doesn't fix the
strange looking three quote levels though.

Thanks to everyone for making Pan, and also thanks to Steve for the
Win32 builds. :)

Andrew

_______________________________________________
Pan-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/pan-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]