Review Request 125921: Don't rely graphic objects in panel script engine
David Edmundson
david at davidedmundson.co.uk
Mon Dec 28 15:43:29 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125921/
-----------------------------------------------------------
(Updated Dec. 28, 2015, 3:43 p.m.)
Review request for Plasma.
Changes
-------
Use a shared function to get the right config
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 (updated)
-----
shell/panelview.h 9f8d4ce9c92e86d81aa8076ca8eb01c0eb8a18c9
shell/panelview.cpp 4dec906b63bd535b3add732f2f5e3971c0a5f37a
shell/scripting/panel.h f7279100a7c79f2f15917b88d8199573a379cb7d
shell/scripting/panel.cpp fb0ff2119850823c4fb76f223ed04f0e9c0d0010
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/20151228/5044ded1/attachment.html>
More information about the Plasma-devel
mailing list