mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
parent
e5a18a171d
commit
72735ae635
4 changed files with 12 additions and 3 deletions
|
@ -124,6 +124,8 @@ in the config.
|
||||||
# Misc
|
# Misc
|
||||||
You can set `splash = true` to enable the splash rendering over the wallpaper.
|
You can set `splash = true` to enable the splash rendering over the wallpaper.
|
||||||
|
|
||||||
|
The value for `splash_offset` sets, in percentage, the splash rendering offset relative to the bottom of the display.
|
||||||
|
|
||||||
## Unloading
|
## Unloading
|
||||||
If you use a lot of wallpapers, consider unloading those that you no longer need. This will mean you need to load them again if you wish to use them for a second time, but will free the memory used by the preloaded bitmap. (Usually 8 - 20MB, depending on the resolution)
|
If you use a lot of wallpapers, consider unloading those that you no longer need. This will mean you need to load them again if you wish to use them for a second time, but will free the memory used by the preloaded bitmap. (Usually 8 - 20MB, depending on the resolution)
|
||||||
|
|
||||||
|
|
|
@ -541,9 +541,9 @@ void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) {
|
||||||
cairo_text_extents_t textExtents;
|
cairo_text_extents_t textExtents;
|
||||||
cairo_text_extents(PCAIRO, SPLASH.c_str(), &textExtents);
|
cairo_text_extents(PCAIRO, SPLASH.c_str(), &textExtents);
|
||||||
|
|
||||||
cairo_move_to(PCAIRO, ((DIMENSIONS.x - textExtents.width * scale) / 2.0) / scale, (DIMENSIONS.y * 0.99 - textExtents.height * scale) / scale);
|
cairo_move_to(PCAIRO, ((DIMENSIONS.x - textExtents.width * scale) / 2.0) / scale, ((DIMENSIONS.y * (100 - m_fSplashOffset)) / 100 - textExtents.height * scale) / scale);
|
||||||
|
|
||||||
Debug::log(LOG, "Splash font size: %d, pos: %.2f, %.2f", FONTSIZE, (DIMENSIONS.x - textExtents.width) / 2.0 / scale, DIMENSIONS.y * 0.95 - textExtents.height / scale);
|
Debug::log(LOG, "Splash font size: %d, pos: %.2f, %.2f", FONTSIZE, (DIMENSIONS.x - textExtents.width) / 2.0 / scale, ((DIMENSIONS.y * (100 - m_fSplashOffset)) / 100 - textExtents.height * scale) / scale);
|
||||||
|
|
||||||
cairo_show_text(PCAIRO, SPLASH.c_str());
|
cairo_show_text(PCAIRO, SPLASH.c_str());
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
|
|
||||||
bool m_bIPCEnabled = true;
|
bool m_bIPCEnabled = true;
|
||||||
bool m_bRenderSplash = false;
|
bool m_bRenderSplash = false;
|
||||||
|
float m_fSplashOffset = 2;
|
||||||
std::string m_szExplicitConfigPath;
|
std::string m_szExplicitConfigPath;
|
||||||
bool m_bNoFractionalScale = false;
|
bool m_bNoFractionalScale = false;
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,13 @@ void CConfigManager::parseKeyword(const std::string& COMMAND, const std::string&
|
||||||
g_pHyprpaper->m_bIPCEnabled = VALUE == "1" || VALUE == "yes" || VALUE == "on" || VALUE == "true";
|
g_pHyprpaper->m_bIPCEnabled = VALUE == "1" || VALUE == "yes" || VALUE == "on" || VALUE == "true";
|
||||||
else if (COMMAND == "splash")
|
else if (COMMAND == "splash")
|
||||||
g_pHyprpaper->m_bRenderSplash = VALUE == "1" || VALUE == "yes" || VALUE == "on" || VALUE == "true";
|
g_pHyprpaper->m_bRenderSplash = VALUE == "1" || VALUE == "yes" || VALUE == "on" || VALUE == "true";
|
||||||
else
|
else if (COMMAND == "splash_offset") {
|
||||||
|
try {
|
||||||
|
g_pHyprpaper->m_fSplashOffset = std::clamp(std::stof(VALUE), 0.f, 100.f);
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
parseError = "invalid splash_offset value " + VALUE;
|
||||||
|
}
|
||||||
|
} else
|
||||||
parseError = "unknown keyword " + COMMAND;
|
parseError = "unknown keyword " + COMMAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue