Review Request 125921: Don't rely graphic objects in panel script engine
David Edmundson
david at davidedmundson.co.uk
Mon Nov 2 16:26:09 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125921/
-----------------------------------------------------------
Review request for Plasma.
Repository: plasma-workspace
Description
-------
The basic design of Plasma is that scripts and and the shell (in theory)
manipulate a tree of basic applet geometry and configs.
Plasmashell then reacts to those changes and displays them visually with
a distinct separation between the layout and UI.
Panel's scriptengine seemed to do away with all, and try and manipulate the graphic object directly..which might not exist and that leads to complex code.
This changes it to read/write from the same config object as
PanelView will use. More akin to how the script engine for applet and contiainment work.
If there's a view for this panel, we update immediately, otherwise it'll just get loaded when it's needed. PanelView::reload() has the error checking/bounds management so no point duplicating that.
Idea is to fix the same bug as https://git.reviewboard.kde.org/r/125920/ but also clean up a lot of the code which I thought had grown a bit complex.
Bit too big to backport though. Might be Plasma 5.6 material at this point.
Diffs
-----
shell/panelview.cpp 2a80a65a9bbcaaad82a52e28525c73e816046a3d
shell/scripting/panel.h f7279100a7c79f2f15917b88d8199573a379cb7d
shell/scripting/panel.cpp bd78fc9b9dd95770126007777b2d41e3822e95ae
Diff: https://git.reviewboard.kde.org/r/125921/diff/
Testing
-------
Modified my layout.js to set min, max sizes as well as alignment and offset which were previously broken.
Once loaded opened the interactive editor and run stuff like:
panel = panelById(1);
panel.alignment = "center"
panel.height = 40
Seems to work as before
Thanks,
David Edmundson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20151102/03a38247/attachment.html>
More information about the Plasma-devel
mailing list