Skip to content

Commit

Permalink
Bugs with Tofu Stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercury13 committed Sep 17, 2022
1 parent 983a253 commit 53cdf9d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
20 changes: 16 additions & 4 deletions Unicodia/FmMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ FmMain::FmMain(QWidget *parent)

auto ib = initBlocks();
initLibrary(ib);
initTerms();
initAbout();

// Tofu stats
auto shcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_T), this);
Expand Down Expand Up @@ -1041,8 +1043,8 @@ void FmMain::translateMe()
loc::translateForm(ui->wiSample);
loc::translateForm(ui->wiLibSample);

initTerms();
initAbout();
translateTerms();
translateAbout();
cjkReflectCollapseState();

ui->comboBlock->resizeView();
Expand All @@ -1059,7 +1061,7 @@ void FmMain::translateMe()
}


void FmMain::initTerms()
void FmMain::translateTerms()
{
QString text;
mywiki::appendStylesheet(text);
Expand All @@ -1086,6 +1088,11 @@ void FmMain::initTerms()
}

ui->vwTerms->setText(text);
}


void FmMain::initTerms()
{
connect(ui->vwTerms, &QTextBrowser::anchorClicked, this, &This::anchorClicked);
}

Expand All @@ -1102,7 +1109,7 @@ namespace {
} // anon namespace


void FmMain::initAbout()
void FmMain::translateAbout()
{
// Get version
auto version = QApplication::applicationVersion();
Expand Down Expand Up @@ -1146,6 +1153,11 @@ void FmMain::initAbout()

// lbTofuStats
ui->lbTofuStats->setText(qPopupLink("About.TofuStats", "ac:tofustats"));
}


void FmMain::initAbout()
{
connect(ui->lbTofuStats, &QLabel::linkActivated, this, &This::showTofuStats);
}

Expand Down
2 changes: 2 additions & 0 deletions Unicodia/FmMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,14 @@ class FmMain : public QMainWindow,

InitBlocks initBlocks();
void initLibrary(const InitBlocks& ib);
void translateAbout();
void initAbout();
void showCp(MaybeChar ch);
void forceShowCp(MaybeChar ch);
void linkClicked(std::string_view link, QWidget* widget, TinyOpt<QRect> rect);
template <SelectMode mode> void selectChar(char32_t code);
void initTerms();
void translateTerms();
void copyCurrentThing(CurrThing thing);
void showCopied(QAbstractItemView* table);
void showCopied(QWidget* widget, const QRect& absRect);
Expand Down
8 changes: 7 additions & 1 deletion Unicodia/FmMain.ui
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<item>
<widget class="QTabWidget" name="tabsMain">
<property name="currentIndex">
<number>1</number>
<number>3</number>
</property>
<widget class="QWidget" name="tabBlocks">
<attribute name="title">
Expand Down Expand Up @@ -859,6 +859,12 @@ padding-bottom: 1px;</string>
</item>
<item>
<widget class="QLabel" name="lbTofuStats">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="text">
<string notr="true">[Tofu stats]</string>
</property>
Expand Down

0 comments on commit 53cdf9d

Please sign in to comment.