mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 10:43:40 +01:00
Update code style
This commit is contained in:
parent
1222764a7c
commit
f796977543
8 changed files with 93 additions and 82 deletions
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
AlignArrayOfStructures: None
|
AlignArrayOfStructures: None
|
||||||
AlignAfterOpenBracket: BlockIndent
|
AlignAfterOpenBracket: BlockIndent
|
||||||
AllowShortBlocksOnASingleLine: Always
|
AllowShortBlocksOnASingleLine: Always
|
||||||
|
@ -30,9 +29,9 @@ SpaceBeforeCpp11BracedList: true
|
||||||
SpaceBeforeCtorInitializerColon: false
|
SpaceBeforeCtorInitializerColon: false
|
||||||
SpaceBeforeInheritanceColon: false
|
SpaceBeforeInheritanceColon: false
|
||||||
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
SpaceBeforeParens: ControlStatementsExceptControlMacros
|
||||||
SortIncludes: CaseInsensitive
|
SortIncludes: CaseSensitive
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
PackConstructorInitializers: CurrentLine
|
PackConstructorInitializers: NextLine
|
||||||
LineEnding: LF
|
LineEnding: LF
|
||||||
InsertBraces: false
|
InsertBraces: false
|
||||||
BreakConstructorInitializers: AfterColon
|
BreakConstructorInitializers: AfterColon
|
||||||
|
@ -59,7 +58,7 @@ BraceWrapping:
|
||||||
SplitEmptyRecord: false
|
SplitEmptyRecord: false
|
||||||
SplitEmptyNamespace: false
|
SplitEmptyNamespace: false
|
||||||
AfterControlStatement: MultiLine
|
AfterControlStatement: MultiLine
|
||||||
BreakBeforeBinaryOperators: All
|
BreakBeforeBinaryOperators: NonAssignment
|
||||||
BreakBeforeTernaryOperators: true
|
BreakBeforeTernaryOperators: true
|
||||||
AlignOperands: AlignAfterOperator
|
AlignOperands: AlignAfterOperator
|
||||||
InsertTrailingCommas: Wrapped
|
InsertTrailingCommas: Wrapped
|
||||||
|
@ -70,3 +69,14 @@ IndentWidth: 2
|
||||||
TabWidth: 2
|
TabWidth: 2
|
||||||
AllowAllConstructorInitializersOnNextLine: false
|
AllowAllConstructorInitializersOnNextLine: false
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||||
|
NamespaceIndentation: None
|
||||||
|
IncludeBlocks: Regroup
|
||||||
|
IncludeCategories:
|
||||||
|
- Regex: '^<(cassert|cctype|cerrno|cfenv|cfloat|cinttypes|climits|clocale|cmath|csetjmp|csignal|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctime|cuchar|cwchar|cwctype|algorithm|any|array|atomic|bitset|chrono|codecvt|complex|condition_variable|deque|exception|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|latch|limits|list|locale|map|memory|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|syncstream|system_error|thread|tuple|type_traits|typeindex|typeinfo|unordered_map|unordered_set|utility|valarray|variant|vector|version|assert.h|ctype.h|errno.h|fenv.h|float.h|inttypes.h|limits.h|locale.h|math.h|setjmp.h|signal.h|stdarg.h|stddef.h|stdint.h|stdio.h|stdlib.h|string.h|time.h|uchar.h|wchar.h|wctype.h)>$'
|
||||||
|
Priority: 0
|
||||||
|
- Regex: '^<.*>$'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '^".*"$'
|
||||||
|
Priority: 2
|
||||||
|
- Regex: '.+'
|
||||||
|
Priority: 3
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
#include <hyprland/src/Compositor.hpp>
|
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "globals.hpp"
|
#include <hyprland/src/Compositor.hpp>
|
||||||
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
|
|
||||||
#include "Hy3Layout.hpp"
|
#include "Hy3Layout.hpp"
|
||||||
#include "SelectionHook.hpp"
|
#include "SelectionHook.hpp"
|
||||||
|
#include "globals.hpp"
|
||||||
|
|
||||||
std::unique_ptr<HOOK_CALLBACK_FN> renderHookPtr
|
std::unique_ptr<HOOK_CALLBACK_FN> renderHookPtr =
|
||||||
= std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::renderHook);
|
std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::renderHook);
|
||||||
std::unique_ptr<HOOK_CALLBACK_FN> windowTitleHookPtr
|
std::unique_ptr<HOOK_CALLBACK_FN> windowTitleHookPtr =
|
||||||
= std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::windowGroupUpdateRecursiveHook);
|
std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::windowGroupUpdateRecursiveHook);
|
||||||
std::unique_ptr<HOOK_CALLBACK_FN> urgentHookPtr
|
std::unique_ptr<HOOK_CALLBACK_FN> urgentHookPtr =
|
||||||
= std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::windowGroupUrgentHook);
|
std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::windowGroupUrgentHook);
|
||||||
std::unique_ptr<HOOK_CALLBACK_FN> tickHookPtr
|
std::unique_ptr<HOOK_CALLBACK_FN> tickHookPtr =
|
||||||
= std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::tickHook);
|
std::make_unique<HOOK_CALLBACK_FN>(Hy3Layout::tickHook);
|
||||||
|
|
||||||
bool performContainment(Hy3Node& node, bool contained, CWindow* window) {
|
bool performContainment(Hy3Node& node, bool contained, CWindow* window) {
|
||||||
if (node.data.type == Hy3NodeType::Group) {
|
if (node.data.type == Hy3NodeType::Group) {
|
||||||
|
@ -102,8 +103,8 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
||||||
|
|
||||||
// opening_after->parent cannot be nullptr
|
// opening_after->parent cannot be nullptr
|
||||||
if (opening_after == root) {
|
if (opening_after == root) {
|
||||||
opening_after
|
opening_after =
|
||||||
= opening_after->intoGroup(Hy3GroupLayout::SplitH, GroupEphemeralityOption::Standard);
|
opening_after->intoGroup(Hy3GroupLayout::SplitH, GroupEphemeralityOption::Standard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +131,8 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
||||||
opening_into = opening_after->parent;
|
opening_into = opening_after->parent;
|
||||||
} else {
|
} else {
|
||||||
if ((opening_into = this->getWorkspaceRootGroup(window->m_iWorkspaceID)) == nullptr) {
|
if ((opening_into = this->getWorkspaceRootGroup(window->m_iWorkspaceID)) == nullptr) {
|
||||||
static const auto* tab_first_window = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tab_first_window")->intValue;
|
static const auto* tab_first_window =
|
||||||
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tab_first_window")->intValue;
|
||||||
|
|
||||||
this->nodes.push_back({
|
this->nodes.push_back({
|
||||||
.data = Hy3GroupLayout::SplitH,
|
.data = Hy3GroupLayout::SplitH,
|
||||||
|
@ -144,12 +146,12 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
||||||
auto& parent = this->nodes.back();
|
auto& parent = this->nodes.back();
|
||||||
|
|
||||||
this->nodes.push_back({
|
this->nodes.push_back({
|
||||||
.parent = &parent,
|
.parent = &parent,
|
||||||
.data = Hy3GroupLayout::Tabbed,
|
.data = Hy3GroupLayout::Tabbed,
|
||||||
.position = parent.position,
|
.position = parent.position,
|
||||||
.size = parent.size,
|
.size = parent.size,
|
||||||
.workspace_id = window->m_iWorkspaceID,
|
.workspace_id = window->m_iWorkspaceID,
|
||||||
.layout = this,
|
.layout = this,
|
||||||
});
|
});
|
||||||
|
|
||||||
parent.data.as_group.children.push_back(&this->nodes.back());
|
parent.data.as_group.children.push_back(&this->nodes.back());
|
||||||
|
@ -239,8 +241,8 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
|
void Hy3Layout::onWindowRemovedTiling(CWindow* window) {
|
||||||
static const auto* node_collapse_policy
|
static const auto* node_collapse_policy =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:node_collapse_policy")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:node_collapse_policy")->intValue;
|
||||||
|
|
||||||
auto* node = this->getNodeFromWindow(window);
|
auto* node = this->getNodeFromWindow(window);
|
||||||
|
|
||||||
|
@ -329,8 +331,8 @@ void Hy3Layout::recalculateMonitor(const int& monitor_id) {
|
||||||
|
|
||||||
if (top_node != nullptr) {
|
if (top_node != nullptr) {
|
||||||
top_node->position = monitor->vecPosition + monitor->vecReservedTopLeft;
|
top_node->position = monitor->vecPosition + monitor->vecReservedTopLeft;
|
||||||
top_node->size
|
top_node->size =
|
||||||
= monitor->vecSize - monitor->vecReservedTopLeft - monitor->vecReservedBottomRight;
|
monitor->vecSize - monitor->vecReservedTopLeft - monitor->vecReservedBottomRight;
|
||||||
top_node->recalcSizePosRecursive();
|
top_node->recalcSizePosRecursive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,8 +371,8 @@ void Hy3Layout::recalculateMonitor(const int& monitor_id) {
|
||||||
|
|
||||||
if (top_node != nullptr) {
|
if (top_node != nullptr) {
|
||||||
top_node->position = monitor->vecPosition + monitor->vecReservedTopLeft;
|
top_node->position = monitor->vecPosition + monitor->vecReservedTopLeft;
|
||||||
top_node->size
|
top_node->size =
|
||||||
= monitor->vecSize - monitor->vecReservedTopLeft - monitor->vecReservedBottomRight;
|
monitor->vecSize - monitor->vecReservedTopLeft - monitor->vecReservedBottomRight;
|
||||||
top_node->recalcSizePosRecursive();
|
top_node->recalcSizePosRecursive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -402,19 +404,19 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
|
||||||
drag_y = corner == CORNER_BOTTOMLEFT || corner == CORNER_BOTTOMRIGHT;
|
drag_y = corner == CORNER_BOTTOMLEFT || corner == CORNER_BOTTOMRIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto animate
|
const auto animate =
|
||||||
= &g_pConfigManager->getConfigValuePtr("misc:animate_manual_resizes")->intValue;
|
&g_pConfigManager->getConfigValuePtr("misc:animate_manual_resizes")->intValue;
|
||||||
|
|
||||||
auto monitor = g_pCompositor->getMonitorFromID(window->m_iMonitorID);
|
auto monitor = g_pCompositor->getMonitorFromID(window->m_iMonitorID);
|
||||||
|
|
||||||
const bool display_left
|
const bool display_left =
|
||||||
= STICKS(node->position.x, monitor->vecPosition.x + monitor->vecReservedTopLeft.x);
|
STICKS(node->position.x, monitor->vecPosition.x + monitor->vecReservedTopLeft.x);
|
||||||
const bool display_right = STICKS(
|
const bool display_right = STICKS(
|
||||||
node->position.x + node->size.x,
|
node->position.x + node->size.x,
|
||||||
monitor->vecPosition.x + monitor->vecSize.x - monitor->vecReservedBottomRight.x
|
monitor->vecPosition.x + monitor->vecSize.x - monitor->vecReservedBottomRight.x
|
||||||
);
|
);
|
||||||
const bool display_top
|
const bool display_top =
|
||||||
= STICKS(node->position.y, monitor->vecPosition.y + monitor->vecReservedTopLeft.y);
|
STICKS(node->position.y, monitor->vecPosition.y + monitor->vecReservedTopLeft.y);
|
||||||
const bool display_bottom = STICKS(
|
const bool display_bottom = STICKS(
|
||||||
node->position.y + node->size.y,
|
node->position.y + node->size.y,
|
||||||
monitor->vecPosition.y + monitor->vecSize.y - monitor->vecReservedBottomRight.y
|
monitor->vecPosition.y + monitor->vecSize.y - monitor->vecReservedBottomRight.y
|
||||||
|
@ -498,8 +500,8 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
|
||||||
// adjust the inner node
|
// adjust the inner node
|
||||||
switch (inner_group.layout) {
|
switch (inner_group.layout) {
|
||||||
case Hy3GroupLayout::SplitH: {
|
case Hy3GroupLayout::SplitH: {
|
||||||
auto ratio_mod
|
auto ratio_mod =
|
||||||
= allowed_movement.x * (float) inner_group.children.size() / inner_parent->size.x;
|
allowed_movement.x * (float) inner_group.children.size() / inner_parent->size.x;
|
||||||
|
|
||||||
auto iter = std::find(inner_group.children.begin(), inner_group.children.end(), inner_node);
|
auto iter = std::find(inner_group.children.begin(), inner_group.children.end(), inner_node);
|
||||||
|
|
||||||
|
@ -548,8 +550,8 @@ void Hy3Layout::resizeActiveWindow(const Vector2D& delta, eRectCorner corner, CW
|
||||||
// adjust the outer node
|
// adjust the outer node
|
||||||
switch (outer_group.layout) {
|
switch (outer_group.layout) {
|
||||||
case Hy3GroupLayout::SplitH: {
|
case Hy3GroupLayout::SplitH: {
|
||||||
auto ratio_mod
|
auto ratio_mod =
|
||||||
= allowed_movement.x * (float) outer_group.children.size() / outer_parent->size.x;
|
allowed_movement.x * (float) outer_group.children.size() / outer_parent->size.x;
|
||||||
|
|
||||||
auto iter = std::find(outer_group.children.begin(), outer_group.children.end(), outer_node);
|
auto iter = std::find(outer_group.children.begin(), outer_group.children.end(), outer_node);
|
||||||
|
|
||||||
|
@ -857,8 +859,8 @@ void Hy3Layout::makeOppositeGroupOn(Hy3Node* node, GroupEphemeralityOption ephem
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& group = node->parent->data.as_group;
|
auto& group = node->parent->data.as_group;
|
||||||
auto layout
|
auto layout =
|
||||||
= group.layout == Hy3GroupLayout::SplitH ? Hy3GroupLayout::SplitV : Hy3GroupLayout::SplitH;
|
group.layout == Hy3GroupLayout::SplitH ? Hy3GroupLayout::SplitV : Hy3GroupLayout::SplitH;
|
||||||
|
|
||||||
if (group.children.size() == 1) {
|
if (group.children.size() == 1) {
|
||||||
group.setLayout(layout);
|
group.setLayout(layout);
|
||||||
|
@ -1131,8 +1133,8 @@ hastab:
|
||||||
return;
|
return;
|
||||||
cont:;
|
cont:;
|
||||||
} else {
|
} else {
|
||||||
auto node_iter
|
auto node_iter =
|
||||||
= std::find(children.begin(), children.end(), tab_node->data.as_group.focused_child);
|
std::find(children.begin(), children.end(), tab_node->data.as_group.focused_child);
|
||||||
if (node_iter == children.end()) return;
|
if (node_iter == children.end()) return;
|
||||||
if (target == TabFocus::Left) {
|
if (target == TabFocus::Left) {
|
||||||
if (node_iter == children.begin()) {
|
if (node_iter == children.begin()) {
|
||||||
|
@ -1743,8 +1745,8 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3Layout::updateAutotileWorkspaces() {
|
void Hy3Layout::updateAutotileWorkspaces() {
|
||||||
static const auto* autotile_raw_workspaces
|
static const auto* autotile_raw_workspaces =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:autotile:workspaces")->strValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:autotile:workspaces")->strValue;
|
||||||
|
|
||||||
if (*autotile_raw_workspaces == this->autotile.raw_workspaces) {
|
if (*autotile_raw_workspaces == this->autotile.raw_workspaces) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include <hyprland/src/Compositor.hpp>
|
#include <hyprland/src/Compositor.hpp>
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
|
|
||||||
#include "globals.hpp"
|
|
||||||
#include "Hy3Node.hpp"
|
#include "Hy3Node.hpp"
|
||||||
|
#include "globals.hpp"
|
||||||
|
|
||||||
// Hy3GroupData //
|
// Hy3GroupData //
|
||||||
|
|
||||||
|
@ -310,15 +310,14 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto expand_focused = group->expand_focused != ExpandFocusType::NotExpanded;
|
auto expand_focused = group->expand_focused != ExpandFocusType::NotExpanded;
|
||||||
bool directly_contains_expanded
|
bool directly_contains_expanded =
|
||||||
= expand_focused
|
expand_focused
|
||||||
&& (group->focused_child->data.type == Hy3NodeType::Window
|
&& (group->focused_child->data.type == Hy3NodeType::Window
|
||||||
|| group->focused_child->data.as_group.expand_focused == ExpandFocusType::NotExpanded);
|
|| group->focused_child->data.as_group.expand_focused == ExpandFocusType::NotExpanded);
|
||||||
|
|
||||||
auto child_count = group->children.size();
|
auto child_count = group->children.size();
|
||||||
double ratio_mul = group->layout != Hy3GroupLayout::Tabbed
|
double ratio_mul =
|
||||||
? child_count <= 0 ? 0 : constraint / child_count
|
group->layout != Hy3GroupLayout::Tabbed ? child_count <= 0 ? 0 : constraint / child_count : 0;
|
||||||
: 0;
|
|
||||||
|
|
||||||
double offset = 0;
|
double offset = 0;
|
||||||
|
|
||||||
|
@ -435,8 +434,8 @@ void Hy3Node::recalcSizePosRecursive(bool no_animation) {
|
||||||
child->size = tsize;
|
child->size = tsize;
|
||||||
child->hidden = this->hidden || expand_focused || group->focused_child != child;
|
child->hidden = this->hidden || expand_focused || group->focused_child != child;
|
||||||
|
|
||||||
child->gap_topleft_offset
|
child->gap_topleft_offset =
|
||||||
= Vector2D(gap_topleft_offset.x, gap_topleft_offset.y + tab_height_offset);
|
Vector2D(gap_topleft_offset.x, gap_topleft_offset.y + tab_height_offset);
|
||||||
child->gap_bottomright_offset = gap_bottomright_offset;
|
child->gap_bottomright_offset = gap_bottomright_offset;
|
||||||
|
|
||||||
child->recalcSizePosRecursive(no_animation);
|
child->recalcSizePosRecursive(no_animation);
|
||||||
|
|
|
@ -22,8 +22,8 @@ void hook_updateDecos(void* thisptr, CWindow* window) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
static const auto decoUpdateCandidates
|
static const auto decoUpdateCandidates =
|
||||||
= HyprlandAPI::findFunctionsByName(PHANDLE, "updateWindowAnimatedDecorationValues");
|
HyprlandAPI::findFunctionsByName(PHANDLE, "updateWindowAnimatedDecorationValues");
|
||||||
|
|
||||||
if (decoUpdateCandidates.size() != 1) {
|
if (decoUpdateCandidates.size() != 1) {
|
||||||
g_LastSelectionHook = nullptr;
|
g_LastSelectionHook = nullptr;
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
|
#include "TabGroup.hpp"
|
||||||
|
|
||||||
#include <cairo/cairo.h>
|
#include <cairo/cairo.h>
|
||||||
#include <hyprland/src/Compositor.hpp>
|
#include <hyprland/src/Compositor.hpp>
|
||||||
#include <hyprland/src/helpers/Color.hpp>
|
#include <hyprland/src/helpers/Color.hpp>
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
|
||||||
#include <hyprland/src/render/OpenGL.hpp>
|
#include <hyprland/src/render/OpenGL.hpp>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
#include <pixman.h>
|
#include <pixman.h>
|
||||||
|
|
||||||
#include "globals.hpp"
|
#include "globals.hpp"
|
||||||
#include "Hy3Layout.hpp"
|
|
||||||
#include "TabGroup.hpp"
|
|
||||||
|
|
||||||
Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) {
|
Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) {
|
||||||
this->focused.create(
|
this->focused.create(
|
||||||
|
@ -342,10 +341,10 @@ exitloop:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto moved
|
auto moved =
|
||||||
= std::find_if(removed_entries.begin(), removed_entries.end(), [&node](auto entry) {
|
std::find_if(removed_entries.begin(), removed_entries.end(), [&node](auto entry) {
|
||||||
return **node == *entry;
|
return **node == *entry;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (moved != removed_entries.end()) {
|
if (moved != removed_entries.end()) {
|
||||||
this->entries.splice(entry, this->entries, *moved);
|
this->entries.splice(entry, this->entries, *moved);
|
||||||
|
@ -451,8 +450,8 @@ Hy3TabGroup::Hy3TabGroup(Hy3Node& node) {
|
||||||
void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
|
void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
|
||||||
static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
|
static const auto* gaps_in = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_in")->intValue;
|
||||||
static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
|
static const auto* gaps_out = &HyprlandAPI::getConfigValue(PHANDLE, "general:gaps_out")->intValue;
|
||||||
static const auto* bar_height
|
static const auto* bar_height =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:height")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:height")->intValue;
|
||||||
|
|
||||||
auto gaps = node.parent == nullptr ? *gaps_out : *gaps_in;
|
auto gaps = node.parent == nullptr ? *gaps_out : *gaps_in;
|
||||||
auto tpos = node.position + Vector2D(gaps, gaps) + node.gap_topleft_offset;
|
auto tpos = node.position + Vector2D(gaps, gaps) + node.gap_topleft_offset;
|
||||||
|
@ -478,10 +477,10 @@ void Hy3TabGroup::updateWithGroup(Hy3Node& node, bool warp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3TabGroup::tick() {
|
void Hy3TabGroup::tick() {
|
||||||
static const auto* enter_from_top
|
static const auto* enter_from_top =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:from_top")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:from_top")->intValue;
|
||||||
static const auto* padding
|
static const auto* padding =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:padding")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:padding")->intValue;
|
||||||
auto* workspace = g_pCompositor->getWorkspaceByID(this->workspace_id);
|
auto* workspace = g_pCompositor->getWorkspaceByID(this->workspace_id);
|
||||||
|
|
||||||
this->bar.tick();
|
this->bar.tick();
|
||||||
|
@ -522,12 +521,12 @@ void Hy3TabGroup::tick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hy3TabGroup::renderTabBar() {
|
void Hy3TabGroup::renderTabBar() {
|
||||||
static const auto* window_rounding
|
static const auto* window_rounding =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "decoration:rounding")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "decoration:rounding")->intValue;
|
||||||
static const auto* enter_from_top
|
static const auto* enter_from_top =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:from_top")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:from_top")->intValue;
|
||||||
static const auto* padding
|
static const auto* padding =
|
||||||
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:padding")->intValue;
|
&HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:padding")->intValue;
|
||||||
|
|
||||||
auto* monitor = g_pHyprOpenGL->m_RenderData.pMonitor;
|
auto* monitor = g_pHyprOpenGL->m_RenderData.pMonitor;
|
||||||
auto* workspace = g_pCompositor->getWorkspaceByID(this->workspace_id);
|
auto* workspace = g_pCompositor->getWorkspaceByID(this->workspace_id);
|
||||||
|
@ -601,8 +600,8 @@ void Hy3TabGroup::renderTabBar() {
|
||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fade_opacity
|
auto fade_opacity =
|
||||||
= this->bar.fade_opacity.fl() * (workspace == nullptr ? 1.0 : workspace->m_fAlpha.fl());
|
this->bar.fade_opacity.fl() * (workspace == nullptr ? 1.0 : workspace->m_fAlpha.fl());
|
||||||
|
|
||||||
auto render_entry = [&](Hy3TabBarEntry& entry) {
|
auto render_entry = [&](Hy3TabBarEntry& entry) {
|
||||||
Vector2D entry_pos = {
|
Vector2D entry_pos = {
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Hy3TabBar;
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
#include <hyprland/src/render/Texture.hpp>
|
#include <hyprland/src/render/Texture.hpp>
|
||||||
|
|
||||||
#include "Hy3Node.hpp"
|
#include "Hy3Node.hpp"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
|
|
||||||
#include "Hy3Layout.hpp"
|
#include "Hy3Layout.hpp"
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
|
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
|
||||||
|
|
||||||
inline HANDLE PHANDLE = nullptr;
|
inline HANDLE PHANDLE = nullptr;
|
||||||
inline std::unique_ptr<Hy3Layout> g_Hy3Layout;
|
inline std::unique_ptr<Hy3Layout> g_Hy3Layout;
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
#include <hyprland/src/Compositor.hpp>
|
#include <hyprland/src/Compositor.hpp>
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
|
|
||||||
|
#include "SelectionHook.hpp"
|
||||||
#include "dispatchers.hpp"
|
#include "dispatchers.hpp"
|
||||||
#include "globals.hpp"
|
#include "globals.hpp"
|
||||||
#include "SelectionHook.hpp"
|
|
||||||
|
|
||||||
APICALL EXPORT std::string PLUGIN_API_VERSION() { return HYPRLAND_API_VERSION; }
|
APICALL EXPORT std::string PLUGIN_API_VERSION() { return HYPRLAND_API_VERSION; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue