Re: How to make a progress-bar thinner?

2012-04-02 Thread Benjamin Otte
2 things:
1) You cannot force widgets smaller than their minimum size in GTK 3. This was
allowed in GTK 2. (And it crashed only sometimes!)
2) You can try to use gtk_widget_set_halign/valign() to make sure the widget
doesn't fill the space it's assigned to.

bonus:
While you look into sizing, you might also want to look into
gtk_widget_set_hexpand/vexpand().

Benjamin



___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How to make a progress-bar thinner?

2012-03-31 Thread Osmo Antero
Ok, I see.

It's rather easy to create a cairo-based (amplitude) level bar.
Here is a sample
http://www.futuredesktop.com/tmp/test3.c

Compile/link with
$ gcc test3.c -o test3 `pkg-config --cflags --libs gtk+-3.0`
and run
$ ./test3

I think I will go for this solution. Would be nice to create a proper
widget class for this.

Cheers,
 Osmo (Moma) Antero

On Fri, Mar 30, 2012 at 9:54 AM, Milan Bouchet-Valat wrote:

> Le vendredi 30 mars 2012 à 09:35 +0200, Osmo Antero a écrit :
> > Hello,
> > How can I make a GtkProgressBar thinner in this application.
> > See:
> > http://www.futuredesktop.com/tmp/test1.c
> > And
> > http://www.futuredesktop.com/tmp/screenshot1.png
> I'm not sure at all you can make it smaller. Actually, the button on the
> left hand-side is higher than the progress bar, so you cannot gain space
> here - and this size depends on the font size, so no luck with padding.
>
> The general problem IMHO is that you're basically trying to theme your
> application, and GTK is really not designed that way. You don't really
> control the appearance of the widgets, at least not at such a detailed
> level.
>
> If you're not happy with the progress bar, you may use a slider instead
> (just like other sound applications).
>
> PS : this list is about discussion of GTK internal development. YOu
> should have used gtk-app-devel-list for this problem.
>
> Regards
>


>Thanks for your reply.
>
>>use a slider instead (just like other sound applications).
>Do you mean the GtkScale widget? It might work well in my case.
>But can I HIDE the slider (the draggable handle) on a GtkScale widget?
>
>Ref: http://developer.gnome.org/gtk3/stable/GtkScale.html
>
> Osmo Antero
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: How to make a progress-bar thinner?

2012-03-30 Thread Milan Bouchet-Valat
Le vendredi 30 mars 2012 à 09:35 +0200, Osmo Antero a écrit :
> Hello,
> How can I make a GtkProgressBar thinner in this application.
> See: 
> http://www.futuredesktop.com/tmp/test1.c 
> And 
> http://www.futuredesktop.com/tmp/screenshot1.png
I'm not sure at all you can make it smaller. Actually, the button on the
left hand-side is higher than the progress bar, so you cannot gain space
here - and this size depends on the font size, so no luck with padding.

The general problem IMHO is that you're basically trying to theme your
application, and GTK is really not designed that way. You don't really
control the appearance of the widgets, at least not at such a detailed
level.

If you're not happy with the progress bar, you may use a slider instead
(just like other sound applications).

PS : this list is about discussion of GTK internal development. YOu
should have used gtk-app-devel-list for this problem.


Regards
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


How to make a progress-bar thinner?

2012-03-30 Thread Osmo Antero
Hello,
How can I make a GtkProgressBar thinner in this application.
See:
http://www.futuredesktop.com/tmp/test1.c
And
http://www.futuredesktop.com/tmp/screenshot1.png

Compile/link the code with
$ gcc test1.c -o test1 `pkg-config --cflags --libs gtk+-3.0`
and run
$ ./test1

I have tried to use GtkAlignment to set the paddings with
gtk_alignment_set_padding(GTK_ALIGNMENT(alignment0), 10, 10, 0, 0);
but this then makes the other widgets in hbox0 thicker/fatter.
Eg. the [Button 1] is fatter than the [Button 2].

This GtkAlignment trick used to work in GTK 2.

The screenshot shows also the actual target application.
I want to make the level indicator (GtkProgressBar) in the audio-recorder
much smaller.

Notice: I have no plans to use gtk-builder or glade.

Do you have any suggestions?

Greetings
 Osmo (Moma) Antero
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list