chore: 格式化ElaWidgetTools代码

This commit is contained in:
sleepwithoutbz
2025-09-20 01:39:00 +08:00
parent d2fded145d
commit 4ab391f8a1
394 changed files with 10913 additions and 15860 deletions

View File

@@ -2,43 +2,30 @@
#include "ElaApplication.h"
#include "ElaPlainTextEdit.h"
#include "ElaTheme.h"
ElaPlainTextEditPrivate::ElaPlainTextEditPrivate(QObject* parent)
: QObject{parent}
{
}
ElaPlainTextEditPrivate::ElaPlainTextEditPrivate(QObject *parent) : QObject{parent} {}
ElaPlainTextEditPrivate::~ElaPlainTextEditPrivate()
{
}
ElaPlainTextEditPrivate::~ElaPlainTextEditPrivate() {}
void ElaPlainTextEditPrivate::onWMWindowClickedEvent(QVariantMap data)
{
void ElaPlainTextEditPrivate::onWMWindowClickedEvent(QVariantMap data) {
Q_Q(ElaPlainTextEdit);
ElaAppBarType::WMMouseActionType actionType = data.value("WMClickType").value<ElaAppBarType::WMMouseActionType>();
if (actionType == ElaAppBarType::WMLBUTTONDOWN)
{
if (!q->toPlainText().isEmpty() && q->hasFocus())
{
if (actionType == ElaAppBarType::WMLBUTTONDOWN) {
if (!q->toPlainText().isEmpty() && q->hasFocus()) {
q->clearFocus();
}
}
else if (actionType == ElaAppBarType::WMLBUTTONUP || actionType == ElaAppBarType::WMNCLBUTTONDOWN)
{
if (ElaApplication::containsCursorToItem(q) || (actionType == ElaAppBarType::WMLBUTTONUP && !q->toPlainText().isEmpty()))
{
} else if (actionType == ElaAppBarType::WMLBUTTONUP || actionType == ElaAppBarType::WMNCLBUTTONDOWN) {
if (ElaApplication::containsCursorToItem(q) || (actionType == ElaAppBarType::WMLBUTTONUP && !q->toPlainText().isEmpty())) {
return;
}
if (q->hasFocus())
{
if (q->hasFocus()) {
q->clearFocus();
}
}
}
void ElaPlainTextEditPrivate::onThemeChanged(ElaThemeType::ThemeMode themeMode)
{
void ElaPlainTextEditPrivate::onThemeChanged(ElaThemeType::ThemeMode themeMode) {
Q_Q(ElaPlainTextEdit);
_themeMode = themeMode;
_themeMode = themeMode;
QPalette palette = q->palette();
palette.setColor(QPalette::Text, ElaThemeColor(_themeMode, BasicText));
palette.setColor(QPalette::PlaceholderText, _themeMode == ElaThemeType::Light ? QColor(0x00, 0x00, 0x00, 128) : QColor(0xBA, 0xBA, 0xBA));