Add Material 3 candidate window addon for Fcitx5
Fork of the classicui addon (Fcitx5 5.1.23) with a Material 3 look, spring based animations and a right click action menu for candidates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
0804634dc1
68 files changed
+11474
No files matched your search
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2020 CSSlayer <wengxt@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
*/
|
||||
#ifndef _FCITX5_UI_CLASSIC_COMMON_H_
|
||||
#define _FCITX5_UI_CLASSIC_COMMON_H_
|
||||
|
||||
#include <memory>
|
||||
#include <glib-object.h>
|
||||
#include <yoga/YGNode.h>
|
||||
#include "fcitx-utils/log.h"
|
||||
#include "fcitx-utils/misc.h"
|
||||
|
||||
namespace fcitx::m3ui {
|
||||
|
||||
template <typename T>
|
||||
using GObjectUniquePtr = UniqueCPtr<T, g_object_unref>;
|
||||
|
||||
template <auto Getter>
|
||||
float absolute(YGNodeRef node) {
|
||||
float offset = 0.0F;
|
||||
while (node) {
|
||||
offset += Getter(node);
|
||||
node = YGNodeGetParent(node);
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
template <auto Getter, typename T, typename Deleter>
|
||||
float absolute(const std::unique_ptr<T, Deleter> &node) {
|
||||
return absolute<Getter>(node.get());
|
||||
}
|
||||
|
||||
FCITX_DECLARE_LOG_CATEGORY(m3ui_logcategory);
|
||||
#define CLASSICUI_DEBUG() \
|
||||
FCITX_LOGC(::fcitx::m3ui::m3ui_logcategory, Debug)
|
||||
#define CLASSICUI_ERROR() \
|
||||
FCITX_LOGC(::fcitx::m3ui::m3ui_logcategory, Error)
|
||||
#define CLASSICUI_INFO() \
|
||||
FCITX_LOGC(::fcitx::m3ui::m3ui_logcategory, Info)
|
||||
|
||||
} // namespace fcitx::m3ui
|
||||
|
||||
#endif // _FCITX5_UI_CLASSIC_COMMON_H_
|
||||
Reference in new issue
Block a user