]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/selectionmode/topbar.cpp
Change the full row highlight checkbox to radiobuttons
[dolphin.git] / src / selectionmode / topbar.cpp
index d783c76caaa017754a05acbb1eeb7e70425b9fcb..0b4cbbda60187632b49d9a8eb67521870727b1c5 100644 (file)
 
 #include <QHBoxLayout>
 #include <QLabel>
-#include <QPalette>
 #include <QPropertyAnimation>
 #include <QPushButton>
 #include <QScrollArea>
 #include <QStyle>
-#include <QtGlobal>
 
 using namespace SelectionMode;
 
@@ -42,7 +40,7 @@ TopBar::TopBar(QWidget *parent) :
     fillParentLayout->setContentsMargins(0, 0, 0, 0);
 
     // Put the contents into a QScrollArea. This prevents increasing the view width
-    // in case that not enough width for the contents is available. (this trick is also used in selectionmodebottombar.cpp.)
+    // in case that not enough width for the contents is available. (this trick is also used in bottombar.cpp.)
     auto scrollArea = new QScrollArea(this);
     fillParentLayout->addWidget(scrollArea);
     scrollArea->setFrameShape(QFrame::NoFrame);
@@ -66,11 +64,10 @@ TopBar::TopBar(QWidget *parent) :
     BackgroundColorHelper::instance()->controlBackgroundColor(m_label);
 
     m_closeButton = new QPushButton(QIcon::fromTheme(QStringLiteral("window-close-symbolic")), "", contentsContainer);
-    m_closeButton->setToolTip(i18nc("@action:button", "Exit Selection Mode"));
-    m_closeButton->setAccessibleName(m_closeButton->toolTip());
+    m_closeButton->setText(i18nc("@action:button", "Exit Selection Mode"));
     m_closeButton->setFlat(true);
-    connect(m_closeButton, &QAbstractButton::pressed,
-            this, &TopBar::leaveSelectionModeRequested);
+    connect(m_closeButton, &QAbstractButton::clicked,
+            this, &TopBar::selectionModeLeavingRequested);
 
     QHBoxLayout *layout = new QHBoxLayout(contentsContainer);
     auto contentsMargins = layout->contentsMargins();
@@ -111,9 +108,10 @@ void TopBar::setVisible(bool visible, Animated animated)
     m_heightAnimation->start(QAbstractAnimation::DeleteWhenStopped);
 }
 
-void TopBar::resizeEvent(QResizeEvent */* resizeEvent */)
+void TopBar::resizeEvent(QResizeEvent *resizeEvent)
 {
     updateLabelString();
+    return QWidget::resizeEvent(resizeEvent);
 }
 
 void TopBar::updateLabelString()