mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2026-05-07 11:18:01 +02:00
add default_zoom
This commit is contained in:
parent
12722021b2
commit
84049540a0
3 changed files with 9 additions and 5 deletions
|
|
@ -35,7 +35,8 @@ plugin {
|
|||
Applies to the scrolling layout overview
|
||||
| property | type | description | default |
|
||||
| --- | --- | --- | --- |
|
||||
| scroll_moves_up_down | bool | if enabled, scrolling will move workspaces up/down instead of zooming | false |
|
||||
| scroll_moves_up_down | bool | if enabled, scrolling will move workspaces up/down instead of zooming | true |
|
||||
| default_zoom | float | default zoom out value, [0.1 - 0.9] | 0.5 |
|
||||
|
||||
|
||||
### Keywords
|
||||
|
|
|
|||
|
|
@ -247,7 +247,8 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:bg_col", Hyprlang::INT{0xFF111111});
|
||||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:workspace_method", Hyprlang::STRING{"center current"});
|
||||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:skip_empty", Hyprlang::INT{0});
|
||||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:scrolling:scroll_moves_up_down", Hyprlang::INT{0});
|
||||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:scrolling:scroll_moves_up_down", Hyprlang::INT{1});
|
||||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:scrolling:default_zoom", Hyprlang::FLOAT{0.5});
|
||||
|
||||
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hyprexpo:gesture_distance", Hyprlang::INT{200});
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,10 @@ CScrollOverview::~CScrollOverview() {
|
|||
}
|
||||
|
||||
CScrollOverview::CScrollOverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn_), swipe(swipe_) {
|
||||
const auto PMONITOR = g_pCompositor->m_lastMonitor.lock();
|
||||
pMonitor = PMONITOR;
|
||||
static auto* const* PDEFAULTZOOM = (Hyprlang::FLOAT* const*)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hyprexpo:scrolling:default_zoom")->getDataStaticPtr();
|
||||
|
||||
const auto PMONITOR = g_pCompositor->m_lastMonitor.lock();
|
||||
pMonitor = PMONITOR;
|
||||
|
||||
for (const auto& w : g_pCompositor->getWorkspaces()) {
|
||||
if (w && w->m_monitor == pMonitor && !w->m_isSpecialWorkspace)
|
||||
|
|
@ -46,7 +48,7 @@ CScrollOverview::CScrollOverview(PHLWORKSPACE startedOn_, bool swipe_) : started
|
|||
viewOffset->setUpdateCallback(damageMonitor);
|
||||
|
||||
if (!swipe)
|
||||
*scale = 0.5F;
|
||||
*scale = std::clamp(**PDEFAULTZOOM, 0.1F, 0.9F);
|
||||
|
||||
lastMousePosLocal = g_pInputManager->getMouseCoordsInternal() - pMonitor->m_position;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue