summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/findbar.cpp11
-rw-r--r--src/findbar.h3
-rw-r--r--src/zoombar.cpp17
-rw-r--r--src/zoombar.h5
4 files changed, 14 insertions, 22 deletions
diff --git a/src/findbar.cpp b/src/findbar.cpp
index 495e4f96..b3b80fac 100644
--- a/src/findbar.cpp
+++ b/src/findbar.cpp
@@ -144,6 +144,7 @@ void FindBar::show()
// show findbar if not visible
if (isHidden())
{
+ emit visibilityChanged(true);
QWidget::show();
emit searchString(m_lineEdit->text());
}
@@ -183,19 +184,13 @@ void FindBar::notifyMatch(bool match)
void FindBar::hide()
{
m_hideTimer->stop();
+ emit visibilityChanged(false);
QWidget::hide();
emit(searchString(m_lineEdit->text()));
}
-void FindBar::setVisible(bool visible)
-{
- emit visibilityChanged(visible);
- QWidget::setVisible(visible);
-}
-
-
void FindBar::toggleVisibility()
{
- setVisible(!isVisible());
+ isVisible() ? hide() : show();
}
diff --git a/src/findbar.h b/src/findbar.h
index 63b2949b..38bbcbc5 100644
--- a/src/findbar.h
+++ b/src/findbar.h
@@ -64,9 +64,6 @@ signals:
void searchString(const QString &);
void visibilityChanged(bool);
-protected:
- void setVisible(bool visible);
-
private:
KLineEdit *m_lineEdit;
QTimer *m_hideTimer;
diff --git a/src/zoombar.cpp b/src/zoombar.cpp
index 485d71a9..b07aee03 100644
--- a/src/zoombar.cpp
+++ b/src/zoombar.cpp
@@ -124,11 +124,19 @@ void ZoomBar::show()
// show findbar if not visible
if (isHidden())
{
+ emit visibilityChanged(true);
QWidget::show();
}
}
+void ZoomBar::hide()
+{
+ emit visibilityChanged(false);
+ QWidget::hide();
+}
+
+
void ZoomBar::zoomIn()
{
setValue(m_zoomSlider->value() + 1);
@@ -168,14 +176,7 @@ void ZoomBar::setValue(int value)
}
-void ZoomBar::setVisible(bool visible)
-{
- emit visibilityChanged(visible);
- QWidget::setVisible(visible);
-}
-
-
void ZoomBar::toggleVisibility()
{
- setVisible(!isVisible());
+ isVisible() ? hide() : show();
}
diff --git a/src/zoombar.h b/src/zoombar.h
index 8e8d9aba..adb0067b 100644
--- a/src/zoombar.h
+++ b/src/zoombar.h
@@ -54,6 +54,8 @@ public:
public slots:
void show();
+ void hide();
+
void zoomIn();
void zoomOut();
void zoomNormal();
@@ -65,9 +67,6 @@ public slots:
signals:
void visibilityChanged(bool);
-protected:
- void setVisible(bool visible);
-
private:
QToolButton *m_zoomIn;
QToolButton *m_zoomOut;