mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
TabIndicator: fix the width of WordCountInfoPanel with scale factor
This commit is contained in:
parent
dceec24021
commit
b0a10d4169
@ -6,6 +6,7 @@
|
|||||||
#include "vorphanfile.h"
|
#include "vorphanfile.h"
|
||||||
#include "vbuttonwithwidget.h"
|
#include "vbuttonwithwidget.h"
|
||||||
#include "vwordcountinfo.h"
|
#include "vwordcountinfo.h"
|
||||||
|
#include "utils/vutils.h"
|
||||||
|
|
||||||
VWordCountPanel::VWordCountPanel(QWidget *p_parent)
|
VWordCountPanel::VWordCountPanel(QWidget *p_parent)
|
||||||
: QWidget(p_parent)
|
: QWidget(p_parent)
|
||||||
@ -49,8 +50,6 @@ VWordCountPanel::VWordCountPanel(QWidget *p_parent)
|
|||||||
mainLayout->addWidget(m_editBox);
|
mainLayout->addWidget(m_editBox);
|
||||||
|
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
setMinimumWidth(300);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VWordCountPanel::updateReadInfo(const VWordCountInfo &p_readInfo)
|
void VWordCountPanel::updateReadInfo(const VWordCountInfo &p_readInfo)
|
||||||
@ -120,6 +119,8 @@ void VTabIndicator::setupUI()
|
|||||||
m_cursorLabel->setProperty("TabIndicatorLabel", true);
|
m_cursorLabel->setProperty("TabIndicatorLabel", true);
|
||||||
|
|
||||||
m_wordCountPanel = new VWordCountPanel(this);
|
m_wordCountPanel = new VWordCountPanel(this);
|
||||||
|
m_wordCountPanel->setMinimumWidth(300 * VUtils::calculateScaleFactor());
|
||||||
|
|
||||||
m_wordCountBtn = new VButtonWithWidget(tr("[W]"), m_wordCountPanel, this);
|
m_wordCountBtn = new VButtonWithWidget(tr("[W]"), m_wordCountPanel, this);
|
||||||
m_wordCountBtn->setToolTip(tr("Word Count Information"));
|
m_wordCountBtn->setToolTip(tr("Word Count Information"));
|
||||||
m_wordCountBtn->setProperty("StatusBtn", true);
|
m_wordCountBtn->setProperty("StatusBtn", true);
|
||||||
@ -223,6 +224,7 @@ void VTabIndicator::update(const VEditTabInfo &p_info)
|
|||||||
void VTabIndicator::updateWordCountInfo(QWidget *p_widget)
|
void VTabIndicator::updateWordCountInfo(QWidget *p_widget)
|
||||||
{
|
{
|
||||||
VWordCountPanel *wcp = dynamic_cast<VWordCountPanel *>(p_widget);
|
VWordCountPanel *wcp = dynamic_cast<VWordCountPanel *>(p_widget);
|
||||||
|
|
||||||
if (!m_editTab) {
|
if (!m_editTab) {
|
||||||
wcp->clear();
|
wcp->clear();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user