1229 Commits

Author SHA1 Message Date
ClementTsang
35ec66eaa7 refactor: cover almost all keybinds except killing processes 2021-09-26 00:30:16 -04:00
ClementTsang
abcca77c1d refactor: add process search conditions and error 2021-09-24 23:19:25 -04:00
ClementTsang
7ee85a82f7 refactor: finish help menu 2021-09-22 01:16:33 -04:00
ClementTsang
e7b9c72912 refactor: add general keybinds, fix buggy movement
Adds back some of the general program keybinds, and fixes both a bug causing
widget movement via keybinds to be incorrect, and not correcting the
last selected widget in the layout tree rows/cols after clicking/setting
the default widget!
2021-09-11 00:46:34 -04:00
ClementTsang
587987a2a5 refactor: add back original behaviour for closing search/sort in proc 2021-09-08 22:48:06 -04:00
ClementTsang
955840b412 refactor: Add back scroll position and expanded 2021-09-07 22:49:10 -04:00
ClementTsang
d8a6a2344e refactor: use a builder for block building 2021-09-07 21:37:11 -04:00
ClementTsang
9ef38cbf1a refactor: add back widget titles
Also has a few clippy fixes and bug fixes:
- Fix redundant rerendering on scroll on time graphs.
- Fix being off by one cell during rendering for no-battery situation
  on the battery widget.
- Fix having empty columns for
  rtl column width calculations (as otherwise it goes to the wrong column).
- Fix rendering issue on small windows with text tables.

We also now ensure that the CPU legend has enough room to draw!
2021-09-07 01:13:17 -04:00
ClementTsang
18af6b01bf refactor: delete a bunch of old unused code 2021-09-05 19:09:11 -04:00
ClementTsang
fa00dec146 refactor: move over battery widget 2021-09-05 19:09:11 -04:00
ClementTsang
eddc9a16c7 refactor: move basic mode over
Because writing your own layout system and management is just *so much
fun*. Totally.

-------------------------------------------------------------------

Moves the basic mode system over to the new drawing/widget system. In
the process, it has forced me to completely redo how we do layouts...
again. This is because basic mode has widgets that control their own
height - this means the height of the columns and rows that wrap it
are also affected by the widget's height.

The previous system, using a constraint tree and splitting draw Rects
via tui-rs' built-in constraint solver, did not support this concept
very well. It was not simple to propagate up the widths/heights
towards parents while also using tui-rs' built-in constraint solver.
In the end, it was easier to just rewrite it using another algorithm.

We now follow a process very similar to Flutter's layout system.
Relevant links to the Flutter docs are found in the code or below:

- https://flutter.dev/docs/development/ui/layout/constraints
- https://flutter.dev/docs/resources/inside-flutter#sublinear-layouts

The gist of it, however, is that we now instead a few new options for
any element in the layout tree. A node can either:

- Grow to fill remaining space
- Take up as much room as its children
- Be a specific length

Technically right now, it's not perfect, in that leaf nodes can be as
large as their children (which makes no sense), though in that case it
just treats it as an expand.
2021-09-05 19:09:11 -04:00
ClementTsang
204b4dc351 refactor: add back grouping and command 2021-09-05 19:09:11 -04:00
ClementTsang
b1889b0934 refactor: add text input 2021-09-05 19:09:11 -04:00
ClementTsang
27736b7fc0 refactor: Add sort capabilities to processes 2021-09-05 19:09:03 -04:00
ClementTsang
3fa50605b3 bug: fix bug causing click bounds to fail
There were three bugs:

1. The click bounds calculation was incorrect. I did the silly mistake
   of checking for <= bounds for the bottom and right sections of a
   Rect when checking if the mouse intersected - this is WRONG.

   For example, let's say you want to calculate if an x value of 5 falls
   between something that starts at 0 and is 5 long.  It shouldn't,
   right?  Because it draws from 0 to 4?  But if you just did <=
   Rect.right(), you would get a hit - because it just does (start +
   width), so you get 5, and 5 <= 5!

   So, easy fix, change all far bounds checks to <.

2. The second bug is a mistake where I accidentally did not include
   bounds sets for my memory and net widgets. Instead, they set their
   bounds to the underlying graph representation, which is WRONG, since
   that bound gets updated on draw, and gets set to a slightly smaller
   rect due to borders!

3. A slightly sneakier one. This broke my bounds checks for the CPU
   widget - and it would have broken my process widget too.

   The problem lies in the concept of widgets that handle multiple
   "sub"-blocks internally, and how I was doing click detection
   internally - I would check if the bounds of the internal Components
   were hit.  Say, the CPU, I would check if the internal graph was hit,
   then if the internal table was hit.

   But wait! I said in point 2 that a graph gets its borders updated on
   draw to something slightly smaller, due to borders!  And there's the
   problem - it affected tables too.  I was setting the bounds of
   components to that of the *internal* representation - without borders
   - but my click detection *needed* borders included!

   Solution?  Add another trait function to check bordered bounds, and
   make the default implementation just check the existing bounds. For
   cases like internal Components that may need it, I add a separate
   implementation.

   I also switched over all border bounds checks for Widgets to that,
   since it's a bit more consistent.
2021-08-30 00:51:09 -04:00
ClementTsang
48c572dbaf refactor: change up event handling logistics
Slightly move around the ideas of EventResult, ReturnSignalResult,
and how they all work.

The gist of it is that we now have widgets returning EventResults (and
renamed to WidgetEventResult), and the main app event handler returns
ReturnSignalResult (now named EventResult).

Also add a new signal to handle re-updating data inputs! This is needed
for the process, and any sortable/configurable widget.
2021-08-29 19:43:27 -04:00
ClementTsang
1ec203caa2 refactor: Add data updating to process widget 2021-08-29 19:33:13 -04:00
ClementTsang
74293aa243 refactor: another pass on sorting and columns 2021-08-29 01:19:34 -04:00
ClementTsang
64d47d54d3 refactor: add network drawing cache system 2021-08-28 22:11:35 -04:00
ClementTsang
2bff04d8a4 refactor: port over graph widgets
Things working as of now:
- Actually drawing
- Interpolation
- Styling
2021-08-28 20:09:00 -04:00
ClementTsang
b72e76aa71 refactor: separate out sorted and non-sorted text tables 2021-08-28 04:16:32 -04:00
ClementTsang
6b69e373de refactor: start moving over the event system 2021-08-28 04:16:32 -04:00
ClementTsang
0afc371eaa refactor: start moving over drawing system
In particular, moving over table-style widgets
2021-08-28 04:16:12 -04:00
ClementTsang
dd7e183ec8 refactor: rip out trait system for drawing widgets
This rips out this weird trait system I previously used for drawing
widgets, where I implemented a trait onto the Painter struct that did
the drawing.  I have no idea what I was thinking back then.
2021-08-24 22:49:06 -04:00
ClementTsang
189be96622 refactor: rename files from mod to their directory names 2021-08-24 22:11:06 -04:00
ClementTsang
b5e6dea324 refactor: more glue code to build layout
Even more glue code to help glue together our layout options to our new
layout system!

Note that this PR will most likely likely break the two options:
- default_widget_type
- default_widget_count
and as such, they'll probably be deleted in a later commit.

As for why, it's since they're kinda a pain to support and don't work
well. Users can still enable default widget selection through the
layout system (which will also see a revamp in the future).
2021-08-24 22:10:46 -04:00
ClementTsang
88ebcab8f2 refactor: add glue to prep for the transition
Write some glue code to transition from the old code to the new one.
2021-08-24 16:03:23 -04:00
ClementTsang
64c6d0c898 refactor + change: write new movement logic 2021-08-23 17:34:52 -04:00
ClementTsang
e657fec2c0 refactor: Create new main widgets 2021-08-23 16:55:32 -04:00
ClementTsang
4f0eb7b7eb refactor: Create basic widget system 2021-08-23 16:55:32 -04:00
ClementTsang
fceae8d442 refactor: clean up some states and code 2021-08-23 16:55:32 -04:00
ClementTsang
5749c32bd5 deps: Update crossterm + tui-rs, along with event handling code 2021-08-23 16:55:32 -04:00
ClementTsang
f73ea0da36 refactor: Start state refactor 2021-08-23 16:55:27 -04:00
Clement Tsang
d1e672f263
ci: add caching to more jobs (#563)
More usage of the caching action to CI/deploy. Seems to save ~3-4 minutes on CI, not sure about deploy.
2021-07-27 18:59:17 -04:00
ClementTsang
758dfd2ee5 github: update bug report formatting 2021-07-25 22:09:15 -04:00
Clement Tsang
74645159bb
other: update default config file (#561)
Update the default config file example in the repo as of 2021-07-25.
2021-07-25 20:17:03 -04:00
allcontributors[bot]
61741015be
docs: add grawlinson as a contributor for doc, platform (#560)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-07-25 19:58:36 -04:00
allcontributors[bot]
2edd78d73a
docs: add TotalCaesar659 as a contributor for doc (#559)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2021-07-25 19:58:14 -04:00
TotalCaesar659
0c1d045085
Update URLs to HTTPS (#558)
This PR updates HTTP URLs to HTTPS for security reasons.
2021-07-25 19:57:04 -04:00
Clement Tsang
bacaca5548
change: add '/s' to network usage legend (#557)
Adds "/s" to the the network usage graph legend.
2021-07-23 19:51:45 -04:00
ClementTsang
a7464d25af docs: update a line in the docs 2021-07-22 14:39:14 -04:00
ClementTsang
f9e48f098d ci: Add comment on product code ps1 script source 2021-07-21 22:46:48 -04:00
Clement Tsang
b24ceea5e1
ci: remove AUR templates (#555)
Removes the AUR templates since they are no longer used in deployment workflows.
2021-07-21 22:45:43 -04:00
Clement Tsang
8aa1303b3c
ci: update winget template + deploy for more info (#554)
Adds a `ProductCode`, `Scope`, and `Commands` field to the template, as well as additional changes to the deploy process to determine + fill in the `ProductCode` automatically.
2021-07-21 22:02:00 -04:00
ClementTsang
bcbdc15b51 docs: update changelog for #551 2021-07-21 11:01:44 -04:00
Clement Tsang
e0f66fee98
docs: fix broken image link in data filtering (#553)
Fixes broken links in the documentation site.
2021-07-19 04:14:02 -04:00
Clement Tsang
895e3cddce
ci: disable AUR packaging (#551)
Since Arch builds are now maintained by a TU in the community repo, I'll be disabling AUR packaging from this point forward. Yay!
2021-07-19 01:30:52 -04:00
Clement Tsang
2d30dbf931
Merge pull request #550 from grawlinson/update_readme
docs: update reference to Arch Linux package
2021-07-18 22:22:01 -07:00
George Rawlinson
3165cb95c1
docs: update reference to Arch Linux package 2021-07-19 02:42:28 +00:00
Clement Tsang
812731ba00
uptick: 0.6.3 (#549)
Uptick README and documentation to 0.6.3.
0.6.3
2021-07-18 13:42:25 -04:00