Technical discussions | Discussions techniques
brianw, Tuesday 08 May 2012 à 05:46
|
|
Subscription date : 25 April 2012
Messages : 270
|
I see in the applet .conf files that some things are greyed out until certain options are chosen. I tried to find a way to implement this for some configuration but I could not find anything. Is this possible?
As an example the Desklet tab has a Decoration section that has options greyed out unless you choose _custom_ is there a way to do this for other items? |
SQP, Tuesday 08 May 2012 à 19:34
|
|
Subscription date : 03 July 2010
Messages : 1081
|
I know this widget that allow to toggle the active state of the next two blocks (full or expandable frame).
#y+[Image;Colour gradation] Fill the background with:
fill bg=0 |
brianw, Wednesday 09 May 2012 à 03:15
|
|
Subscription date : 25 April 2012
Messages : 270
|
Thanks SQP, that works perfectly.
For anyone wanting to know how to use it (the choice in the #y+ line activates the first second or third block (or whatever you put in) and sets the variable listGroup, the other 2 blocks are greyed out and can't be changed, although in your plugin file all keys can be read even if they are greyed out so your code must take into account the variable indicating which option group is selected):
#y+[Use list 1; Use list 2;Use list 3]Choose which set of options to choose from?
listGroup=0
#L[Blue item 1;Blue item 2;Blue item 3]Choose and item from the Blue group:
blueGroupItem=
#l[2;4;6;8]Choose from number group:
numberSelected=
#L[Apples, Oranges, Grapes]Choose from fruit group:
fruitChoice=
The above can also be used to grey out entire Frame blocks using the #F flag (but it can't be used with expandable frames, #X because it just expends the selected frame and contracts the unselected frame it does not grey it out you can still expand the frame and make changes). If the frameGroup drop down is on Use Frame 2 then both options in frame 1 are greyed out and can't be changed (again your plugin file will still read whatever value they are set to so you need to use the frameGroup variable (or whatever name you give it) to make decisions in your code.
#y+[Use frame 1; Use frame 2]Choose which frame to choose from?
frameGroup=0
#F[Frame Group 1]
frameGroup1=
#b One option in this first frame:
option1Toggle=true
#b Second option in the first frame:
option2Toggle=false
#F [Frame Group 2]
frameGroup2=
#D Choose a directory:
#{This is an example directory path}
myDirectory=
|
matttbe, Wednesday 09 May 2012 à 12:30
|
|
Subscription date : 24 January 2009
Messages : 12573
|
Thank you for this tip |
Subscription date : 30 November 2007
Messages : 17118
|
yep, the documentation is poor about .conf files
this tip is nice and should go in the wiki, I would add the following:
To control the numer of widgets that are greyed after the current widget, use #B and #Y
- B[3] allows to grey the 3 next widgets if the box is not ticked.
- B[-3] is the same but if the box is ticked
- Y{Choice 1;1;2;Choice 2;3;1] : selecting Choice1 will enable 2 widgets from widget n°1, and selecting Choice2 will enable 1 widget from widget n°3 (widget n°0 is the current widget)
all widgets are listed in cairo-dock-gui-factory.h and most of them are used in cairo-dock.conf |
brianw, Thursday 10 May 2012 à 23:01
|
|
Subscription date : 25 April 2012
Messages : 270
|
thanks fabounet,
I had seen this done (if the box is checked/not checked) in applet configs but wasn't sure how to do it. Thanks for that info. That is more of what I was looking for before.
fabounet : yep, the documentation is poor about .conf files
That is why feedback from users and developers is so important. No matter how much people try to get the documentation correct there is always something that gets missed. Without help from you, SQP, matttbe and the others those of us struggling to do our things would not be able to get it done. Also when we find something that might help or is incorrect then it is important for us to bring it up somewhere so that things improve. Just keeping up with improvements and bug fixes must keep you guys super busy so any help you can get from us is very important.
After seeing the cairo-dock-gui-factory.h you mentioned I remembered that SQP had supplied that file name before. Not being experienced enough before with what I was doing I didn't put too much thought into it. Now, after getting some experience, I know what I am looking for in it. As an example I was looking for a text widget and now know which one it is (I was using 'Z' incorrectly when I should be using 'W', learn from experience).
I really appreciate all the help and support and hope that as I learn more anything I can give back is useful.
Anyway, thanks for the great dock and the ability to add back to it.
EDIT: I see the description for the widget #W is incorrect in the file. It states that it is a simple text label but by the name of the widget it is a link. The text label is the #> I tried the #W widget in the .conf file an seen the link name so looked at the cairo-dock-gui-factory.h file again and the description says it is a label but the widget name is CAIRO_DOCK_WIDGET_LINK which I should have picked up on when I first read it instead of just reading the description. |
Subscription date : 30 November 2007
Messages : 17118
|
ok thanks for reporting this and helping the dock to get better
Note to me: refresh the documentation for the 3.1 |
Technical discussions | Discussions techniques
|