代码拉取完成,页面将自动刷新
同步操作将从 爬山虎/ndd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "texteditsetwin.h"
#include "scintillaeditview.h"
#include "ccnotepad.h"
#include <QFontDialog>
TextEditSetWin::TextEditSetWin(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
if (ScintillaEditView::s_tabLens >= 0 && ScintillaEditView::s_tabLens <= 16)
{
ui.spinBoxTabLens->setValue(ScintillaEditView::s_tabLens);
}
ui.checkBoxReplaceTabToSpace->setChecked(ScintillaEditView::s_noUseTab);
ui.BigTextSizeLimit->setValue(ScintillaEditView::s_bigTextSize);
ui.restoreFile->setChecked((CCNotePad::s_restoreLastFile == 1));
}
TextEditSetWin::~TextEditSetWin()
{
save();
}
#if 0
//弹出对话框时,默认初始化该值
void TextEditSetWin::setFont(QFont &font)
{
if (m_curFont != font)
{
m_curFont = font;
}
ui.curTextFontEdit->setText(font.toString());
}
#endif
#if 0
//弹出对话框时,默认初始化该值
void TextEditSetWin::setProgramLangFont(QFont &font)
{
if (m_curProLangFont != font)
{
m_curProLangFont = font;
}
ui.curProLangFontEdit->setText(font.toString());
}
#endif
void TextEditSetWin::save()
{
bool lenChange = false;
if (ui.spinBoxTabLens->value() != ScintillaEditView::s_tabLens)
{
ScintillaEditView::s_tabLens = ui.spinBoxTabLens->value();
lenChange = true;
}
bool useChange = false;
if (ui.checkBoxReplaceTabToSpace->isChecked() != ScintillaEditView::s_noUseTab)
{
ScintillaEditView::s_noUseTab = ui.checkBoxReplaceTabToSpace->isChecked();
useChange = true;
}
if (lenChange || useChange)
{
emit sendTabFormatChange(lenChange, useChange);
}
if (ui.BigTextSizeLimit->value() != ScintillaEditView::s_bigTextSize)
{
ScintillaEditView::s_bigTextSize = ui.BigTextSizeLimit->value();
}
int restoreFile = ui.restoreFile->isChecked() ? 1 : 0;
if (restoreFile != CCNotePad::s_restoreLastFile)
{
CCNotePad::s_restoreLastFile = restoreFile;
}
}
#if 0
void TextEditSetWin::slot_selectFont()
{
QFont ft;
#if defined(Q_OS_WIN)
ft.fromString(u8"宋体,14,-1,5,50,0,0,0,0,0,常规");
#elif defined(Q_OS_MAC)
ft.fromString(u8"STSong,14,-1,5,50,0,0,0,0,0,Regular");
#else
ft.fromString(u8"CESI宋体-GB2312,12,-1,5,50,0,0,0,0,0,Regular");
#endif
bool ok = false;//定义bool型输出变量
ft = QFontDialog::getFont(&ok, m_curFont, this,tr("User define Txt Font"));
if (ok)
{
ui.curTextFontEdit->setText(ft.toString());
if (m_curFont != ft)
{
m_curFont = ft;
emit signTxtFontChange(ft);
}
}
else
{
ui.curTextFontEdit->setText(ft.toString());
m_curFont = ft;
}
}
#endif
#if 0
void TextEditSetWin::slot_selectProLangFont()
{
#if defined(Q_OS_WIN)
QFont ft("Courier New", QsciLexer::s_defaultFontSize);
#elif defined(Q_OS_MAC)
QFont ft("Menlo", s_defaultFontSize);
#else
QFont ft("Bitstream Vera Sans", 9);
#endif
bool ok = false;//定义bool型输出变量
ft = QFontDialog::getFont(&ok, m_curProLangFont, this, tr("User define Txt Font"));
if (ok)
{
ui.curProLangFontEdit->setText(ft.toString());
if (m_curProLangFont != ft)
{
m_curProLangFont = ft;
emit signProLangFontChange(ft);
}
}
else
{
ui.curProLangFontEdit->setText(ft.toString());
m_curProLangFont = ft;
}
}
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。