Author Topic: [Solved] Need help for a layout tweak  (Read 4106 times)

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
[Solved] Need help for a layout tweak
« on: November 07, 2011, 22: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 :
On :

"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".

« Last Edit: November 10, 2011, 11:02:46 by mgrubert »

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1100
    • View Profile
Re : Need help for a layout tweak
« Reply #1 on: November 07, 2011, 23:14:43 »
If I understood correctly, this example behave like you want, the close button uses the ShowHideWidget to hide everything :
Code: [Select]
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))

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Need help for a layout tweak
« Reply #2 on: November 09, 2011, 21: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.

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re : Need help for a layout tweak
« Reply #3 on: November 10, 2011, 11: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 :

On (with artistinfo) :

On (with queue) :

mgrubert

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
Re: [Solved] Need help for a layout tweak
« Reply #4 on: November 16, 2011, 16: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)


Second : (HBButtonMore on) (you can switch between queue and context in the panel with ToggleButton2 and ToggleButton3 and HBButtonLess go back to First view)