mirror of https://github.com/hyprwm/Hypr.git
bar config monitor added
This commit is contained in:
parent
4c11e3355f
commit
7d6a8e8ee7
|
@ -5,14 +5,18 @@
|
||||||
|
|
||||||
#include "../windowManager.hpp"
|
#include "../windowManager.hpp"
|
||||||
|
|
||||||
void CStatusBar::setup(Vector2D origin, Vector2D size) {
|
void CStatusBar::setup(int MonitorID) {
|
||||||
if (origin.x != -1 && origin.y != -1) {
|
|
||||||
m_vecPosition = origin;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (size.x != -1 && size.y != -1) {
|
if (MonitorID > g_pWindowManager->monitors.size()) {
|
||||||
m_vecSize = size;
|
MonitorID = 0;
|
||||||
|
Debug::log(ERR, "Incorrect value in MonitorID for the bar. Setting to 0.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto MONITOR = g_pWindowManager->monitors[MonitorID];
|
||||||
|
|
||||||
|
m_iMonitorID = MonitorID;
|
||||||
|
m_vecPosition = MONITOR.vecPosition;
|
||||||
|
m_vecSize = Vector2D(MONITOR.vecSize.x, ConfigManager::getInt("bar_height"));
|
||||||
|
|
||||||
uint32_t values[4];
|
uint32_t values[4];
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ public:
|
||||||
EXPOSED_MEMBER(MonitorID, int, i);
|
EXPOSED_MEMBER(MonitorID, int, i);
|
||||||
|
|
||||||
void draw();
|
void draw();
|
||||||
void setup(Vector2D, Vector2D);
|
void setup(int MonitorID);
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -13,9 +13,12 @@ void ConfigManager::init() {
|
||||||
configValues["border_size"].intValue = 1;
|
configValues["border_size"].intValue = 1;
|
||||||
configValues["gaps_in"].intValue = 5;
|
configValues["gaps_in"].intValue = 5;
|
||||||
configValues["gaps_out"].intValue = 20;
|
configValues["gaps_out"].intValue = 20;
|
||||||
configValues["bar_height"].intValue = 15;
|
|
||||||
configValues["max_fps"].intValue = 60;
|
configValues["max_fps"].intValue = 60;
|
||||||
|
|
||||||
|
configValues["bar_monitor"].intValue = 0;
|
||||||
|
configValues["bar_height"].intValue = 15;
|
||||||
|
|
||||||
loadConfigLoadVars();
|
loadConfigLoadVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +145,7 @@ void ConfigManager::loadConfigLoadVars() {
|
||||||
// Reload the bar as well, don't load it before the default is loaded.
|
// Reload the bar as well, don't load it before the default is loaded.
|
||||||
if (loadBar) {
|
if (loadBar) {
|
||||||
g_pWindowManager->statusBar.destroy();
|
g_pWindowManager->statusBar.destroy();
|
||||||
g_pWindowManager->statusBar.setup(Vector2D(-1, -1), Vector2D(g_pWindowManager->monitors[g_pWindowManager->statusBar.getMonitorID()].vecSize.x, configValues["bar_height"].intValue));
|
g_pWindowManager->statusBar.setup(configValues["bar_monitor"].intValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadBar = true;
|
loadBar = true;
|
||||||
|
|
|
@ -143,9 +143,7 @@ void CWindowManager::setupManager() {
|
||||||
|
|
||||||
for (auto& monitor : monitors) {
|
for (auto& monitor : monitors) {
|
||||||
if (monitor.primary) {
|
if (monitor.primary) {
|
||||||
const Vector2D BARSIZE = Vector2D(monitor.vecSize.x, ConfigManager::getInt("bar_height"));
|
statusBar.setup(ConfigManager::configValues["bar_monitor"].intValue);
|
||||||
statusBar.setup(monitor.vecPosition, BARSIZE);
|
|
||||||
statusBar.setMonitorID(monitor.ID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue