Merge pull request #12 from namecheap/bugfix/RND-709-macos-tool-settings-side-panel-on-retina

Bugfix/rnd 709 macos tool settings side panel on retina
This commit is contained in:
Yurii Puchkov
2020-12-04 13:19:10 +02:00
committed by GitHub
3 changed files with 8 additions and 16 deletions

View File

@@ -695,9 +695,17 @@ void CaptureWidget::initPanel()
m_panel = new UtilityPanel(this);
makeChild(m_panel);
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
defined(Q_OS_MACX))
QScreen* currentScreen = QGuiApplication::screenAt(QCursor::pos());
panelRect.moveTo(mapFromGlobal(panelRect.topLeft()));
m_panel->setFixedWidth(m_colorPicker->width() * 1.5);
m_panel->setFixedHeight(currentScreen->geometry().height());
#else
panelRect.moveTo(mapFromGlobal(panelRect.topLeft()));
panelRect.setWidth(m_colorPicker->width() * 1.5);
m_panel->setGeometry(panelRect);
#endif
SidePanelWidget* sidePanel = new SidePanelWidget(&m_context.screenshot);
connect(sidePanel,

View File

@@ -137,14 +137,4 @@ void UtilityPanel::initInternalPanel()
m_internalPanel->setStyleSheet(
QStringLiteral("QScrollArea {background-color: %1}").arg(bgColor.name()));
m_internalPanel->hide();
m_hide = new QPushButton();
m_hide->setText(tr("Hide"));
m_upLayout->addWidget(m_hide);
connect(m_hide, SIGNAL(clicked()), this, SLOT(slotHidePanel()));
}
void UtilityPanel::slotHidePanel()
{
hide();
}

View File

@@ -38,13 +38,8 @@ public:
void hide();
void show();
signals:
void mouseEnter();
void mouseLeave();
public slots:
void toggle();
void slotHidePanel();
private:
void initInternalPanel();
@@ -56,5 +51,4 @@ private:
QVBoxLayout* m_layout;
QPropertyAnimation* m_showAnimation;
QPropertyAnimation* m_hideAnimation;
QPushButton* m_hide;
};