Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

simotek
Copy link

@simotek simotek commented May 1, 2023

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 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
@simotek
Copy link
Author

simotek commented May 1, 2023

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')
Copy link
Owner

@philer philer May 6, 2023

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.

Copy link
Author

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.

@philer
Copy link
Owner

philer commented May 6, 2023

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.

widget_graph - This could have a better name * Bar * Graph * LED

I agree. How about indicator.lua?

@simotek
Copy link
Author

simotek commented May 8, 2023

indicator.lua sounds like good suggestion, i'll add it to tomorrows list.

simotek added 5 commits May 9, 2023 10:59
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
@simotek
Copy link
Author

simotek commented May 9, 2023

Changes made, I also included the updates to #14 so they don't get lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants