Move more settings over to pajlada settings system
This commit is contained in:
@@ -22,7 +22,7 @@ NotebookTab::NotebookTab(Notebook *_notebook)
|
||||
|
||||
this->positionChangedAnimation.setEasingCurve(QEasingCurve(QEasingCurve::InCubic));
|
||||
|
||||
this->hideXConnection = SettingsManager::getInstance().hideTabX.valueChanged.connect(
|
||||
this->hideXConnection = SettingsManager::getInstance().hideTabX.getValueChangedSignal().connect(
|
||||
boost::bind(&NotebookTab::hideTabXChanged, this, _1));
|
||||
|
||||
this->setMouseTracking(true);
|
||||
@@ -62,14 +62,15 @@ NotebookTab::NotebookTab(Notebook *_notebook)
|
||||
|
||||
NotebookTab::~NotebookTab()
|
||||
{
|
||||
this->hideXConnection.disconnect();
|
||||
SettingsManager::getInstance().hideTabX.getValueChangedSignal().disconnect(
|
||||
this->hideXConnection);
|
||||
}
|
||||
|
||||
void NotebookTab::calcSize()
|
||||
{
|
||||
float scale = getDpiMultiplier();
|
||||
|
||||
if (SettingsManager::getInstance().hideTabX.get()) {
|
||||
if (SettingsManager::getInstance().hideTabX) {
|
||||
this->resize(static_cast<int>((fontMetrics().width(title) + 16) * scale),
|
||||
static_cast<int>(24 * scale));
|
||||
} else {
|
||||
@@ -184,12 +185,12 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||
painter.setPen(fg);
|
||||
|
||||
float scale = this->getDpiMultiplier();
|
||||
int rectW = (SettingsManager::getInstance().hideTabX.get() ? 0 : static_cast<int>(16) * scale);
|
||||
int rectW = (SettingsManager::getInstance().hideTabX ? 0 : static_cast<int>(16) * scale);
|
||||
QRect rect(0, 0, this->width() - rectW, this->height());
|
||||
|
||||
painter.drawText(rect, title, QTextOption(Qt::AlignCenter));
|
||||
|
||||
if (!SettingsManager::getInstance().hideTabX.get() && (mouseOver || selected)) {
|
||||
if (!SettingsManager::getInstance().hideTabX && (mouseOver || selected)) {
|
||||
QRect xRect = this->getXRect();
|
||||
if (mouseOverX) {
|
||||
painter.fillRect(xRect, QColor(0, 0, 0, 64));
|
||||
@@ -231,7 +232,7 @@ void NotebookTab::mouseReleaseEvent(QMouseEvent *event)
|
||||
this->notebook->removePage(this->page);
|
||||
}
|
||||
} else {
|
||||
if (!SettingsManager::getInstance().hideTabX.get() && this->mouseDownX &&
|
||||
if (!SettingsManager::getInstance().hideTabX && this->mouseDownX &&
|
||||
this->getXRect().contains(event->pos())) {
|
||||
this->mouseDownX = false;
|
||||
|
||||
@@ -264,7 +265,7 @@ void NotebookTab::dragEnterEvent(QDragEnterEvent *)
|
||||
|
||||
void NotebookTab::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
if (!SettingsManager::getInstance().hideTabX.get()) {
|
||||
if (!SettingsManager::getInstance().hideTabX) {
|
||||
bool overX = this->getXRect().contains(event->pos());
|
||||
|
||||
if (overX != this->mouseOverX) {
|
||||
|
||||
Reference in New Issue
Block a user