1 Star 0 Fork 0

旷野芦苇殇/texteditor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
colorschemeedit.h 3.00 KB
一键复制 编辑 原始数据 按行查看 历史
旷野芦苇殇 提交于 2024-08-02 17:06 +08:00 . 初始化
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "colorscheme.h"
#include "fontsettings.h"
#include <QDialog>
QT_BEGIN_NAMESPACE
class QAbstractButton;
class QCheckBox;
class QComboBox;
class QDoubleSpinBox;
class QLabel;
class QListView;
class QModelIndex;
class QScrollArea;
class QToolButton;
QT_END_NAMESPACE
namespace TextEditor::Internal {
class FormatsModel;
/*!
A widget for editing a color scheme. Used in the FontSettingsPage.
*/
class ColorSchemeEdit : public QWidget
{
Q_OBJECT
public:
ColorSchemeEdit(QWidget *parent = nullptr);
~ColorSchemeEdit() override;
void setFormatDescriptions(const FormatDescriptions &descriptions);
void setBaseFont(const QFont &font);
void setReadOnly(bool readOnly);
void setColorScheme(const ColorScheme &colorScheme);
const ColorScheme &colorScheme() const;
signals:
void copyScheme();
private:
void currentItemChanged(const QModelIndex &index);
void changeForeColor();
void changeBackColor();
void eraseForeColor();
void eraseBackColor();
void changeRelativeForeColor();
void changeRelativeBackColor();
void eraseRelativeForeColor();
void eraseRelativeBackColor();
void checkCheckBoxes();
void changeUnderlineColor();
void eraseUnderlineColor();
void changeUnderlineStyle(int index);
void updateControls();
void updateForegroundControls();
void updateBackgroundControls();
void updateRelativeForegroundControls();
void updateRelativeBackgroundControls();
void updateFontControls();
void updateUnderlineControls();
void setItemListBackground(const QColor &color);
void populateUnderlineStyleComboBox();
private:
FormatDescriptions m_descriptions;
ColorScheme m_scheme;
int m_curItem = -1;
FormatsModel *m_formatsModel;
bool m_readOnly = false;
QListView *m_itemList;
QLabel *m_builtinSchemeLabel;
QWidget *m_fontProperties;
QLabel *m_foregroundLabel;
QToolButton *m_foregroundToolButton;
QAbstractButton *m_eraseForegroundToolButton;
QLabel *m_backgroundLabel;
QToolButton *m_backgroundToolButton;
QAbstractButton *m_eraseBackgroundToolButton;
QLabel *m_relativeForegroundHeadline;
QLabel *m_foregroundLightnessLabel;
QDoubleSpinBox *m_foregroundLightnessSpinBox;
QLabel *m_foregroundSaturationLabel;
QDoubleSpinBox *m_foregroundSaturationSpinBox;
QLabel *m_relativeBackgroundHeadline;
QLabel *m_backgroundSaturationLabel;
QDoubleSpinBox *m_backgroundSaturationSpinBox;
QLabel *m_backgroundLightnessLabel;
QDoubleSpinBox *m_backgroundLightnessSpinBox;
QLabel *m_fontHeadline;
QCheckBox *m_boldCheckBox;
QCheckBox *m_italicCheckBox;
QLabel *m_underlineHeadline;
QLabel *m_underlineLabel;
QToolButton *m_underlineColorToolButton;
QAbstractButton *m_eraseUnderlineColorToolButton;
QComboBox *m_underlineComboBox;
};
} // TextEditor::Internal
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fengzhu2007/texteditor.git
git@gitee.com:fengzhu2007/texteditor.git
fengzhu2007
texteditor
texteditor
main

搜索帮助