Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
ef5e4f94
Commit
ef5e4f94
authored
Jul 14, 2020
by
Shubham .
Browse files
Fix reset zoom button enability
parent
d9801515
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/panelplugins/documentationpanel/documentationpanelwidget.cpp
View file @
ef5e4f94
...
...
@@ -143,16 +143,26 @@ DocumentationPanelWidget::DocumentationPanelWidget(const QString& backend, const
// Add zoom in, zoom out behaviour on SHIFT++ and SHIFT--
auto
zoomIn
=
new
QShortcut
(
QKeySequence
(
Qt
::
SHIFT
+
Qt
::
Key_Plus
),
this
);
zoomIn
->
setContext
(
Qt
::
WidgetWithChildrenShortcut
);
connect
(
zoomIn
,
&
QShortcut
::
activated
,
this
,
[
=
]{
m_textBrowser
->
setZoomFactor
(
m_textBrowser
->
zoomFactor
()
+
0.1
);
emit
zoomFactorChanged
();
});
auto
zoomOut
=
new
QShortcut
(
QKeySequence
(
Qt
::
SHIFT
+
Qt
::
Key_Minus
),
this
);
zoomOut
->
setContext
(
Qt
::
WidgetWithChildrenShortcut
);
connect
(
zoomOut
,
&
QShortcut
::
activated
,
this
,
[
=
]{
m_textBrowser
->
setZoomFactor
(
m_textBrowser
->
zoomFactor
()
-
0.1
);
emit
zoomFactorChanged
();
});
connect
(
this
,
&
DocumentationPanelWidget
::
zoomFactorChanged
,
[
=
]{
if
(
m_textBrowser
->
zoomFactor
()
!=
1.0
)
resetZoom
->
setEnabled
(
true
);
else
resetZoom
->
setEnabled
(
false
);
});
/////////////////////////
// Display area layout//
...
...
@@ -165,7 +175,6 @@ DocumentationPanelWidget::DocumentationPanelWidget(const QString& backend, const
* This widget would be NEVER shown*/
m_displayArea
->
addWidget
(
m_index
);
/////////////////////////////////
// Find in Page widget layout //
///////////////////////////////
...
...
@@ -216,7 +225,7 @@ DocumentationPanelWidget::DocumentationPanelWidget(const QString& backend, const
//TODO QHelpIndexWidget::linkActivated is obsolete, use QHelpIndexWidget::documentActivated instead
// display the documentation browser whenever contents are clicked
connect
(
m_engine
->
contentWidget
(),
&
QHelpContentWidget
::
linkActivated
,
[
=
]
()
{
connect
(
m_engine
->
contentWidget
(),
&
QHelpContentWidget
::
linkActivated
,
[
=
]{
m_displayArea
->
setCurrentIndex
(
1
);
});
...
...
@@ -231,13 +240,11 @@ DocumentationPanelWidget::DocumentationPanelWidget(const QString& backend, const
{
findPage
->
setEnabled
(
false
);
home
->
setEnabled
(
false
);
resetZoom
->
setEnabled
(
false
);
}
else
{
findPage
->
setEnabled
(
true
);
home
->
setEnabled
(
true
);
resetZoom
->
setEnabled
(
true
);
}
});
...
...
@@ -247,6 +254,7 @@ DocumentationPanelWidget::DocumentationPanelWidget(const QString& backend, const
connect
(
resetZoom
,
&
QPushButton
::
clicked
,
[
=
]{
m_textBrowser
->
setZoomFactor
(
1.0
);
resetZoom
->
setEnabled
(
false
);
});
connect
(
m_engine
->
contentWidget
(),
&
QHelpContentWidget
::
linkActivated
,
this
,
&
DocumentationPanelWidget
::
displayHelp
);
...
...
src/panelplugins/documentationpanel/documentationpanelwidget.h
View file @
ef5e4f94
...
...
@@ -54,6 +54,7 @@ class DocumentationPanelWidget : public QWidget
Q_SIGNALS:
void
activateBrowser
();
void
zoomFactorChanged
();
private
Q_SLOTS
:
void
displayHelp
(
const
QUrl
&
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment