-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial revert of #141 and improved properties #142
Conversation
- removed id, x, y, w, h from props - PViewMethodsInterface: added method id() - PUI.getViewById: changed argument type from String to int - PViewsArea: removed method addView(PViewMethodsInterface) - api/widgets: renamed StylePropertiesProxy to PropertiesProxy - api/PUI: renamed getStyle to getProps - api/widgets/PropertiesProxy: changed methods remove, putAll, clear to trigger changed event - api/widgets/PropertiesProxy: added methods change() and change(String, Object) - api/widgets/PropertiesProxy: implemented methods has, delete, getIds, getDefaultValue, hasInstance - api/widgets/PropertiesProxy.containsValue: fixed bugs related to calls the wrong method - api/widgets/PropertiesProxy.put(String, Object): fixed bugs related to doesn't return the previous value - api/widgets/Styler: added methods apply(String, Object) and apply(String) - api/widgets/Styler: moved put id to PropertiesProxy() - api/widgets/Styler: moved methods fromTo and setProps to WidgetHelper - api/widgets/Styler: removed methods setX, setY, setWidth and setHeight in favor of WidgetHelper.applyLayoutParams - api/widgets/WidgetHelper: added method applyLayoutParams
…or property textColor
…eturn this - api/widgets/PLinearLayout.add: changed to behave like PAbsoluteLayout.addView - api/widgets/PLinearLayout: added method add(View, String, Object, Object, float)
Hi! I just had a quick read on the changes and this direction seems right to me.
I will refrain my self to approve and merge it too quickly this time :) |
- x, y, w, h, textAlign, textColor, textFont, textSize, textStyle, background, text - PImage: srcMode - PInput: hint, multiline - PKnob: decimals, from, to, value - PLinearLayout: orientation, horizontalAlign, verticalAlign - PList: columns, stackFromEnd - PMap: controls, maxZoom, minZoom, multitouch, online, zoom - PSlider: decimals, from, mode, to, value, vertical - PSpinner: align - PText: autoFit, scrollable - PToggle: checked, textOff, textOn - api/widgets/PKnob: replaced class KnobStyler with method apply - api/widgets/PSlider: replaced class SliderStyler with method apply - api/widgets/PToggle: replaced class ToggleStyler with method apply - api/widgets/Styler: changed to support custom textAlign, textColor, textFont, textStyle - api/widgets/WidgetHelper: renamed method applyLayoutParams to applyViewParam - api/widgets: added properties enabled, visibility - api/PUI: changed to apply theme changes like props changes - api/PUtil.sizeToPixels: changed to support constants
nP :) The PR is ready to test and review now. I ran the GUI examples and my application, and they seem fine. The commit messages should summarize the changes for an easier review. If you have any doubts, let me know! |
- examples: added example Linear Layout
- PPlot: max, min, name - PTextList: autoScroll - api/widgets/PPlot: replaced class PlotStyler with method apply
- api/widgets/PKnob: added property autoTextSize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@notEvil I'm approving and merging the PR.
The only think I might change at some point in the future is the example you added to simplify it a tiny bit. I really appreciate that you added!
Thanks so much for your effort!
Great :) Just for reference:
So it might be worthwhile to revisit each widget and see if it fullfills its purpose and has all relevant properties. If you would write a list of things to improve, I'd certainly contribute! :)
I agree, its too complicated. |
I noticed the removed code. Thanks for doing it. Many things were intentions that never resolved :) So better removed for clarity. Regarding the tasks, there is 4 things that I wanted to have since long time
If there is something that interests you from this list (or something else) I'd be more than happy to support you in any way. |
I meant improvements regarding widgets and layout, since this is where I can reuse the knowledge I have atm. For the other things I fear my knowledge (e.g. vue, ML on Android, app bundling) doesn't suffice and their absence don't bug me enough to commit to it. The documentation however is an area where you might see a PR in the future! (didn't start yet) |
Hi,
I didn't consider #141 final (#139 (comment)) so this PR partially reverts its changes.
Instead of having separate containers for id, style, layout(, state) as proposed, I found that improving the way changes are applied already provides better separation and fits previous conventions. Essentially
PropertiesProxy
(previouslyStylePropertiesProxy
) now triggers the changed event withname == null
when multiple properties changed, andname != null && value == null
when properties are deletedPropertiesProxy.onChange
is called by widgets instead ofStyler
name
andvalue
to various functions:Styler.apply
andWidgetHelper.applyLayoutParams
To review this, it is probably better to compare with 3c4024e and consider it a replacement for #141 which I consider inferior and less backwards compatible. Sorry!
If you agree, I would also add "content" (text, checked, ...) back to props.
Changes