mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-31 16:02:43 +01:00 
			
		
		
		
	feat(workspaces): add urgent, visible class
This commit is contained in:
		| @@ -13,6 +13,7 @@ | |||||||
| - Memory | - Memory | ||||||
| - Cpu load average | - Cpu load average | ||||||
| - Custom scripts | - Custom scripts | ||||||
|  | - And much more customizations | ||||||
|  |  | ||||||
| **Configuration and Customization** | **Configuration and Customization** | ||||||
|  |  | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ window { | |||||||
|     font-size: 10px; |     font-size: 10px; | ||||||
| } | } | ||||||
|  |  | ||||||
| #workspaces button.current { | #workspaces button.focused { | ||||||
|     background: #64727D; |     background: #64727D; | ||||||
|     border-bottom: 3px solid white; |     border-bottom: 3px solid white; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -53,9 +53,17 @@ auto waybar::modules::Workspaces::update() -> void | |||||||
|     } else { |     } else { | ||||||
|       auto &button = it->second; |       auto &button = it->second; | ||||||
|       if (node["focused"].asBool()) |       if (node["focused"].asBool()) | ||||||
|         button.get_style_context()->add_class("current"); |         button.get_style_context()->add_class("focused"); | ||||||
|       else |       else | ||||||
|         button.get_style_context()->remove_class("current"); |         button.get_style_context()->remove_class("focused"); | ||||||
|  |       if (node["visible"].asBool()) | ||||||
|  |         button.get_style_context()->add_class("visible"); | ||||||
|  |       else | ||||||
|  |         button.get_style_context()->remove_class("visible"); | ||||||
|  |       if (node["urgent"].asBool()) | ||||||
|  |         button.get_style_context()->add_class("urgent"); | ||||||
|  |       else | ||||||
|  |         button.get_style_context()->remove_class("urgent"); | ||||||
|       if (needReorder) |       if (needReorder) | ||||||
|         _box.reorder_child(button, node["num"].asInt()); |         _box.reorder_child(button, node["num"].asInt()); | ||||||
|       button.show(); |       button.show(); | ||||||
| @@ -89,7 +97,11 @@ void waybar::modules::Workspaces::_addWorkspace(Json::Value node) | |||||||
|     .connect(sigc::mem_fun(*this, &Workspaces::_handleScroll)); |     .connect(sigc::mem_fun(*this, &Workspaces::_handleScroll)); | ||||||
|   _box.reorder_child(button, node["num"].asInt()); |   _box.reorder_child(button, node["num"].asInt()); | ||||||
|   if (node["focused"].asBool()) |   if (node["focused"].asBool()) | ||||||
|     button.get_style_context()->add_class("current"); |     button.get_style_context()->add_class("focused"); | ||||||
|  |   if (node["visible"].asBool()) | ||||||
|  |     button.get_style_context()->add_class("visible"); | ||||||
|  |   if (node["urgent"].asBool()) | ||||||
|  |     button.get_style_context()->add_class("urgent"); | ||||||
|   button.show(); |   button.show(); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexis
					Alexis