mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-17 04:53:48 -07:00
cursormgr: implement inheriting themes for xcursor (#7197)
* cursormgr: reduce duplicated code add a few functions such as setCursorBuffer and setAnimationTimer to reduce duplicated code and also avoid future mishaps of forgetting to clear buffer or disarm timer. and generally reduce spaghetti even tho pasta can be delicious. * xcursormgr: implent inherited themes implent index.theme parsing and inherited themes. * cursormgr: ensure a fallback xcursor exist ensure a xcursor fallback exist otherwise it wont load the proper theme if we at launch have hyprcursor enabled and then set it to false in config and reload. also use the env var when using hyprctl setcursor incase its empty.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_set>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <hyprutils/math/Vector2D.hpp>
|
||||
@@ -32,15 +33,15 @@ class CXCursorManager {
|
||||
SP<SXCursors> getShape(std::string const& shape, int size);
|
||||
|
||||
private:
|
||||
SP<SXCursors> createCursor(std::string const& shape, XcursorImages* xImages);
|
||||
std::vector<std::string> themePaths(std::string const& theme);
|
||||
std::string getLegacyShapeName(std::string const& shape);
|
||||
std::vector<SP<SXCursors>> loadStandardCursors(std::string const& name, int size);
|
||||
std::vector<SP<SXCursors>> loadAllFromDir(std::string const& path, int size);
|
||||
SP<SXCursors> createCursor(std::string const& shape, XcursorImages* xImages);
|
||||
std::unordered_set<std::string> themePaths(std::string const& theme);
|
||||
std::string getLegacyShapeName(std::string const& shape);
|
||||
std::vector<SP<SXCursors>> loadStandardCursors(std::string const& name, int size);
|
||||
std::vector<SP<SXCursors>> loadAllFromDir(std::string const& path, int size);
|
||||
|
||||
int lastLoadSize = 0;
|
||||
std::string themeName = "";
|
||||
SP<SXCursors> defaultCursor;
|
||||
SP<SXCursors> hyprCursor;
|
||||
std::vector<SP<SXCursors>> cursors;
|
||||
int lastLoadSize = 0;
|
||||
std::string themeName = "";
|
||||
SP<SXCursors> defaultCursor;
|
||||
SP<SXCursors> hyprCursor;
|
||||
std::vector<SP<SXCursors>> cursors;
|
||||
};
|
Reference in New Issue
Block a user