gmusicbrowser Forum

Main board => Customization => Topic started by: mgrubert on November 07, 2011, 17:03:19

Title: [Solved] Need help for a layout tweak
Post by: mgrubert on November 07, 2011, 17:03:19
Hi guys,

I try a kind of tweak for buttons.

In my layout I have a "Plus button" to show more buttons => it's ok :

Off : (http://perpendiculaires.free.fr/documents/Images/Plus_off.png)
On : (http://perpendiculaires.free.fr/documents/Images/Plus_on.png)

"Album button" shows widget Album
"Queue button" shows widget Queue
"Info button" shows widget Context
and they are grouped (it's Album and no Queue and no Context, or no Album and Queue and no context, or no Album and no Queue and Context)

And I want the "Close button" to : close Album or Queue or Context and put the "Plus button" off (which will close the more buttons widget).

But I can't reach this goal.

Actually the best I done is : grouping together Album, Queue, Info and Close (widget=none) and the "Close button" close Album or Queue or Context but it doesn't close the "Plus button".

Title: Re : Need help for a layout tweak
Post by: Quentin Sculo on November 07, 2011, 18:14:43
If I understood correctly, this example behave like you want, the close button uses the ShowHideWidget to hide everything :
Window= hidden=Button1|Button2|Button3
HBtoggle= ToggleButton1(icon=gtk-add,widget=Button1|Button2|Button3) Button1(stock=gmb-album) Button2(stock=gmb-artist) Button3(stock=gtk-remove,activate=ShowHideWidget(Button1|Button2|Button3))

Title: Re : Need help for a layout tweak
Post by: mgrubert on November 09, 2011, 16:03:03
Hum, ShowHideWidget doesn't seem to work at home.
And, if I understand, your button3 only hide the buttons 1, 2 and 3, but I want him to close the widget they had show.

In french :

La fonction ShowHideWidget ne semble pas fonctionner chez moi.
Et si je comprends bien ton bouton 3 masque les boutons 1, 2 et 3 mais je voudrais aussi que le bouton 3 désactive les widgets que les boutons 1 et 2 auraient pu montrer.
Title: Re : Need help for a layout tweak
Post by: mgrubert on November 10, 2011, 06:02:24
I find a way :
I put the widgets associated to buttons 2 and 3 in the same contener. When I toggle button 1, it shows buttons 2 and 3 AND the contener. So when I untoggle button 1, it hides button 2 and 3 and the contener.

Off : (http://www.zimagez.com/miniature/capturedcran-10112011-065912.php) (http://www.zimagez.com/zimage/capturedcran-10112011-065912.php)

On (with artistinfo) : (http://www.zimagez.com/miniature/capturedcran-10112011-070032.php) (http://www.zimagez.com/zimage/capturedcran-10112011-070032.php)

On (with queue) : (http://www.zimagez.com/miniature/capturedcran-10112011-070144.php) (http://www.zimagez.com/zimage/capturedcran-10112011-070144.php)
Title: Re: [Solved] Need help for a layout tweak
Post by: mgrubert on November 16, 2011, 11:20:16
I found a better way to do that :


Hidden : Queue|VBQueue&Context|VBMoreButton|HBButtonLess

VBQueue&Context = Queue Context

HBButton = HBButtonMore HBMoreButtons HBButtonLess

    HBButtonMore = ToggleButton1(togglegroup=1,icon=gtk-add,widget=VBQueueAndContext|HBMoreButtons|HBButtonLess,tip=_"More")
    HBMoreButtons = (togglegroup=1) \
                                ToggleButton2(togglegroup=2,icon=gmb-queue,widget=Queue,tip=_"Queue") \
                      ToggleButton3(togglegroup=2,icon=gtk-about,widget=Context,tip=_"Context")
    HBButtonLess = ToggleButton4(togglegroup=1,icon=gtk-remove,widget=HBButtonMore,tip=_"Less")

First : (HBButtonMore off)
(http://pix.toile-libre.org/upload/img/1321442066.png) (http://pix.toile-libre.org/?img=1321442066.png)

Second : (HBButtonMore on) (you can switch between queue and context in the panel with ToggleButton2 and ToggleButton3 and HBButtonLess go back to First view)
(http://pix.toile-libre.org/upload/img/1321442323.png) (http://pix.toile-libre.org/?img=1321442323.png)