Skip to content

Conversation

@parmort
Copy link
Contributor

@parmort parmort commented May 9, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

Adds universal module visibility control actions toggle_visible, set_visible, and set_invisible.

Related Issues & Documents

#2108
#2320
#2342

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

parmort added 3 commits May 9, 2021 19:06
`action_toggle_visible` -> `action_toggle_visibility`

Matches with `EVENT_TOGGLE_VISIBILITY`
@codecov
Copy link

codecov bot commented May 9, 2021

Codecov Report

Merging #2426 (39977ac) into master (10bbec4) will increase coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head 39977ac differs from pull request most recent head eff14db. Consider uploading reports for the commit eff14db to get more accurate results
Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2426   +/-   ##
======================================
  Coverage    9.83%   9.83%           
======================================
  Files         147     147           
  Lines       10492   10489    -3     
======================================
  Hits         1032    1032           
+ Misses       9460    9457    -3     
Flag Coverage Δ
unittests 9.83% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/components/controller.hpp 0.00% <ø> (ø)
include/modules/meta/base.hpp 0.00% <ø> (ø)
include/modules/meta/base.inl 0.00% <0.00%> (ø)
src/components/controller.cpp 0.00% <ø> (ø)
src/modules/bspwm.cpp 0.00% <0.00%> (ø)
src/x11/tray_client.cpp 0.00% <0.00%> (ø)
src/x11/tray_manager.cpp 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10bbec4...eff14db. Read the comment docs.

parmort added 2 commits May 9, 2021 19:25
IPC commands are no longer necessary now that the actions are
implemented. Changed some method permissions as well to reflect this.
@patrick96
Copy link
Member

Nice 😃

I don't really have time to review right now, I got a lot going on. It's gonna be at least a few weeks until I get to this.

Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

This change does also require documentation in doc/user/actions.rst. I would say we add a new subsection to "Available Actions" named "All modules" at the beginning, just before the date module.

Also, maybe we should, just by convention, have a module_ prefix for all global module actions to prevent future naming conflicts.
To be consistent with the command names to change bar visibility, we could use the names module_toggle, module_show, module_hide. What do you think?


template <typename Impl>
void module<Impl>::set_visible(bool value) {
// m_log.info("%s: Visibility changed (state=%s)", m_name, value ? "shown" : "hidden");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// m_log.info("%s: Visibility changed (state=%s)", m_name, value ? "shown" : "hidden");
m_log.info("%s: Visibility changed (state=%s)", m_name, value ? "shown" : "hidden");

@parmort
Copy link
Contributor Author

parmort commented Jul 6, 2021

To be consistent with the command names to change bar visibility, we could use the names module_toggle, module_show, module_hide. What do you think?

Yeah, that sounds like a good idea. I remember not being sure what to call them. I'll get the changes up in a few minutes.

parmort added 2 commits July 6, 2021 14:44
- `module_toggle`
- `module_show`
- `module_hide`

Delineate common actions to all modules with a `module_` prefix (for
future actions too)
Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@patrick96 patrick96 merged commit 0693200 into polybar:master Jul 7, 2021
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