-
Notifications
You must be signed in to change notification settings - Fork 5
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
Split Widgets into seperate files / modules #15
base: master
Are you sure you want to change the base?
Conversation
This will hopefully make them easier to maintain in the long term. The main polycore config all the examples and tests have been updated although the test suite isn't rendering for me. For now the split is as follows, but open to changes and suggestions: * widget_core * Widget * Rows * Columns * Filler * Frame * widget_cpu * Cpu * CpuRound * CpuFrequencies * widget_drive * Drive * widget_gpu * Gpu * GpuTop * widget_graph - This could have a better name * Bar * Graph * LED * widget_memory * MemoryBar * MemoryGrid * widget_network * Network * widget_text * Text * StaticText * TextLine
This should probably be accepted after #14 as due to the file add remove etc its already been included. |
* Now paint the backgrounds in the pre section. * Unfortunatly we need to clear and repaint all backgrounds every cycle, unless we want to start tracking which widgets overlap others.
local gpu = require('src/widgets/gpu') | ||
local mem = require('src/widgets/memory') | ||
local net = require('src/widgets/network') | ||
local text = require('src/widgets/text') |
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.
Please avoid aligning like this, it's tedious to maintain and makes diffs longer.
Also I don't think the aliases below are really necessary.
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.
Can do, I noticed you used aliases in some places but not others, if you'd prefer without I can make that change though.
Nice, I think the splits make sense. I don't like splitting files like this because it completely obscures the git history (I frequently backtrack to understand what I was doing in the past). But I guess by now that file has just gotten way to long.
I agree. How about |
|
Rather then re rendering widget backgrounds every update they are now rendered to a separate surface which is remerged with the main surface when it is cleared.
* Don't line up requires * Don't worry about aliasing module names
Changes made, I also included the updates to #14 so they don't get lost. |
This will hopefully make them easier to maintain in the long term. The main polycore config all the examples and tests have been updated although the test suite isn't rendering for me. For now the split is as follows, but open to changes and suggestions: