This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to create a vertical panel from a script?

Tags: None
(comma "," separated)
MadiG
Registered Member
Posts
7
Karma
0
OS
I want to create a vertical panel in my init js, but all i can get is horizontal panel! Can i create a vertical one?

Thanks...
MadiG
Registered Member
Posts
7
Karma
0
OS
Aaron J. Seigo said: <<or you could do "desktop console" in krunner, then enter something like this in there:
panel = new Panel
panel.location = 'left'>>

But it creates horizontal panel!!!!!
MadiG
Registered Member
Posts
7
Karma
0
OS
I was wrong!
Code: Select all
panel = new Panel
panel.location = 'left'

creates vertical panel, but its width is equal to screen width by default, so it looks like horizontal panel!
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
EDIT:
I looked into the issue. To make your panel smaller, you need to do something like this (it'll make it 100 px long):

Code: Select all
var mypanel = new Panel
mypanel.location = 'left'
mypanel.length = 48
mypanel.height = 100
mypanel.alignment = "center"


This should do the trick. Notice that "length" for vertical panels means the height and "height" the length of the panel. (i.e., they are swapped compared to horizontal panels).


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
MadiG
Registered Member
Posts
7
Karma
0
OS
einar wrote:EDIT:
I looked into the issue. To make your panel smaller, you need to do something like this (it'll make it 100 px long):

Code: Select all
var mypanel = new Panel
mypanel.location = 'left'
mypanel.length = 48
mypanel.height = 100
mypanel.alignment = "center"


This should do the trick. Notice that "length" for vertical panels means the height and "height" the length of the panel. (i.e., they are swapped compared to horizontal panels).

Thank you, i've understood it. With default length and height vertical panel looks like horizontal - that was my problem!
But! There is another question. The maximum panel height i can get with init script is equal to 1/3 of my screen height (i.e. 256=768/3) even if i set
panel.height=700, for example.
How can i override this limit? (OS is kubuntu 10.4)
(p.s.: via update script i can set height as i wish)
MadiG
Registered Member
Posts
7
Karma
0
OS
einar wrote:Notice that "length" for vertical panels means the height and "height" the length of the panel. (i.e., they are swapped compared to horizontal panels).

There's another interesting thing. When you modify already created vertical panel (via update script) its "height" becomes its height and its "length" becomes its length (as it should be).
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
I suggest you email plasma-devel@kde.org asking if it's a feature or a bug. Providing sample code and showing simple test cases to reproduce would also help.
Also, what do you mean by "update script"?


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
MadiG
Registered Member
Posts
7
Karma
0
OS
einar wrote:Also, what do you mean by "update script"?


From PlasmaDesktopScripting:
There are three ways that scripts can be executed in plasma-desktop:

* on first run: when plasma-desktop is started without any pre-existing configuration, any scripts in $APPDATA/plasma-desktop/init/ with a ".js" suffix are run...
* on update: when plasma-desktop is started, it will check in `kde4-config --path data`/plasma-desktop/updates/ with a ".js" suffix for scripts that have not yet been run...
* interactively...


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]