GNOME Bugzilla – Bug 565144
balance midpoint
Last modified: 2009-01-26 19:48:23 UTC
The balance slider should have a visible/noticable midpoint, and some easy way to reset to it.
Completely agree. Also the range widget is the wrong choice because it shows the left/lesser side of the range as a different color from the other.
I've added an implementation of 'marks' for GtkScale in bug 565656
And here is an example that shows how to turn of the filled drawing for an individual scale. This works fine with Clearlooks. See http://bugzilla.redhat.com/show_bug.cgi?id=477941 for what needs to happen to make it work with the default Fedora theme.
Created attachment 125323 [details] test.c
Created attachment 125695 [details] [review] a working patch
*** Bug 567590 has been marked as a duplicate of this bug. ***
Created attachment 126929 [details] [review] Add left/right/middle marks to balance scroll Just a 5 minute hack, maybe I removed too much [v|h]boxes :) To check: * how many marks we want? 3? 5? * RTL/LTR behavior (left is left, right is right, should not swap) * gtk version in configure OT: "Balance:" label should provide an accelerator, as per HIG
3, because there's only 3 special points: left, middle, right. and yes, rtl flipping is a bad idea here, so better set a fixed text direction on the scale.
It crashes with gtk2-2.15.1-4.fc11.x86_64, with the patch applied: ==29746== Invalid free() / delete / delete[] ==29746== at 0x4A0609F: free (vg_replace_malloc.c:323) ==29746== by 0x4FC0D85: _gtk_range_set_stop_values (gtkrange.c:3605) ==29746== by 0x4FE0CB3: gtk_scale_finalize (gtkscale.c:1176) ==29746== by 0x343560D958: g_object_unref (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4EB6432: gtk_box_forall (gtkbox.c:1249) ==29746== by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066) ==29746== by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421) ==29746== by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== Address 0xfae1f08 is 0 bytes inside a block of size 24 free'd ==29746== at 0x4A0609F: free (vg_replace_malloc.c:323) ==29746== by 0x4FC31AD: gtk_range_destroy (gtkrange.c:1227) ==29746== by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421) ==29746== by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4EB6432: gtk_box_forall (gtkbox.c:1249) ==29746== by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066) ==29746== by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0) ==29746== ==29746== Invalid free() / delete / delete[] ==29746== at 0x4A0609F: free (vg_replace_malloc.c:323) ==29746== by 0x4FC0DB9: _gtk_range_set_stop_values (gtkrange.c:3608) ==29746== by 0x4FE0CB3: gtk_scale_finalize (gtkscale.c:1176) ==29746== by 0x343560D958: g_object_unref (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4EB6432: gtk_box_forall (gtkbox.c:1249) ==29746== by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066) ==29746== by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421) ==29746== by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== Address 0xfae1f50 is 0 bytes inside a block of size 12 free'd ==29746== at 0x4A0609F: free (vg_replace_malloc.c:323) ==29746== by 0x4FC31C0: gtk_range_destroy (gtkrange.c:1228) ==29746== by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435623D08: g_signal_emit_valist (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x3435624272: g_signal_emit (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4FA89DD: gtk_object_dispose (gtkobject.c:421) ==29746== by 0x343560DD4F: g_object_run_dispose (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x4EB6432: gtk_box_forall (gtkbox.c:1249) ==29746== by 0x4EEDB75: gtk_container_destroy (gtkcontainer.c:1066) ==29746== by 0x343560B77E: g_closure_invoke (in /lib64/libgobject-2.0.so.0.1902.0) ==29746== by 0x34356229F6: (within /lib64/libgobject-2.0.so.0.1902.0)
This patch against GTK+ should fix it. Index: gtkrange.c =================================================================== --- gtkrange.c (revision 22222) +++ gtkrange.c (working copy) @@ -1225,7 +1225,9 @@ if (range->layout->n_marks) { g_free (range->layout->marks); + range->layout->marks = NULL; g_free (range->layout->mark_pos); + range->layout->mark_pos = NULL; range->layout->n_marks = 0; }
2009-01-26 Bastien Nocera <hadess@hadess.net> * src/gvc-balance-bar.c (_scale_box_new), (gvc_balance_bar_init): Patch from Luca Ferretti <elle.uca@libero.it>, to use the new GTK+ scale marks for the balance widget (Closes: #565144) 2009-01-26 Bastien Nocera <hadess@hadess.net> * src/gvc-balance-bar.c (gvc_balance_bar_init): Make sure the balance bar stays Left to Right, so that the Left balance is really on the left I also added a mnemonic to the Balance slider.