Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
PIM Messagelib
Commits
99607506
Commit
99607506
authored
Apr 26, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move zoom in webengineviewer
parent
65753b5a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
128 additions
and
20 deletions
+128
-20
CMakeLists.txt
CMakeLists.txt
+1
-1
messageviewer/autotests/CMakeLists.txt
messageviewer/autotests/CMakeLists.txt
+0
-1
messageviewer/src/CMakeLists.txt
messageviewer/src/CMakeLists.txt
+0
-2
messageviewer/src/viewer/viewer_p.cpp
messageviewer/src/viewer/viewer_p.cpp
+3
-3
messageviewer/src/viewer/viewer_p.h
messageviewer/src/viewer/viewer_p.h
+2
-2
webengineviewer/src/CMakeLists.txt
webengineviewer/src/CMakeLists.txt
+19
-2
webengineviewer/src/autotests/CMakeLists.txt
webengineviewer/src/autotests/CMakeLists.txt
+6
-0
webengineviewer/src/autotests/zoomactionmenutest.cpp
webengineviewer/src/autotests/zoomactionmenutest.cpp
+55
-0
webengineviewer/src/autotests/zoomactionmenutest.h
webengineviewer/src/autotests/zoomactionmenutest.h
+34
-0
webengineviewer/src/widgets/zoomactionmenu.cpp
webengineviewer/src/widgets/zoomactionmenu.cpp
+3
-4
webengineviewer/src/widgets/zoomactionmenu.h
webengineviewer/src/widgets/zoomactionmenu.h
+5
-5
No files found.
CMakeLists.txt
View file @
99607506
...
...
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include
(
ECMQtDeclareLoggingCategory
)
include
(
ECMAddTests
)
set
(
MESSAGELIB_LIB_VERSION
"5.2.
59
"
)
set
(
MESSAGELIB_LIB_VERSION
"5.2.
60
"
)
set
(
KF5_VERSION
"5.19.0"
)
set
(
KDEPIMLIBS_LIB_VERSION
"5.2.40"
)
...
...
messageviewer/autotests/CMakeLists.txt
View file @
99607506
...
...
@@ -25,7 +25,6 @@ macro(add_messageviewer_class_unittest _source _additionalSource)
endmacro
()
add_messageviewer_unittest
(
messagedisplayformatattributetest.cpp
)
add_messageviewer_class_unittest
(
zoomactionmenutest.cpp
"../src/widgets/zoomactionmenu.cpp"
)
# convenience macro to add qtest unit tests
macro
(
add_messageviewer_mailsourceviewbrowserwidget_unittest _source
)
...
...
messageviewer/src/CMakeLists.txt
View file @
99607506
...
...
@@ -81,7 +81,6 @@ set(libmessageviewer_widgets_SRCS
widgets/openattachmentfolderwidget.cpp
widgets/mailsourceviewer.cpp
widgets/mailsourceviewtextbrowserwidget.cpp
widgets/zoomactionmenu.cpp
)
set
(
libmessageviewer_widgets_webengine_SRCS
...
...
@@ -278,7 +277,6 @@ ecm_generate_headers(MessageViewer_Camelcasewidgets_HEADERS
InvitationSettings
PrintingSettings
ConfigureWidget
ZoomActionMenu
REQUIRED_HEADERS MessageViewer_widgets_HEADERS
PREFIX MessageViewer
RELATIVE widgets
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
99607506
...
...
@@ -142,7 +142,7 @@
#include <QStandardPaths>
#include <header/headerstyleplugin.h>
#include <viewerplugins/viewerplugininterface.h>
#include <
widgets/z
oom
a
ction
m
enu
.h
>
#include <
WebEngineViewer/Z
oom
A
ction
M
enu>
#include <kpimtextedit/texttospeechwidget.h>
#include <grantleetheme/grantleethememanager.h>
...
...
@@ -1510,8 +1510,8 @@ void ViewerPrivate::createActions()
if
(
!
ac
)
{
return
;
}
mZoomActionMenu
=
new
Messag
eViewer
::
ZoomActionMenu
(
this
);
connect
(
mZoomActionMenu
,
&
ZoomActionMenu
::
zoomChanged
,
mViewer
,
&
MailWebEngineView
::
slotZoomChanged
);
mZoomActionMenu
=
new
WebEngin
eViewer
::
ZoomActionMenu
(
this
);
connect
(
mZoomActionMenu
,
&
WebEngineViewer
::
ZoomActionMenu
::
zoomChanged
,
mViewer
,
&
MailWebEngineView
::
slotZoomChanged
);
mZoomActionMenu
->
setActionCollection
(
ac
);
mZoomActionMenu
->
createZoomActions
();
...
...
messageviewer/src/viewer/viewer_p.h
View file @
99607506
...
...
@@ -75,6 +75,7 @@ namespace WebEngineViewer
{
class
WebHitTestResult
;
class
FindBarWebEngineView
;
class
ZoomActionMenu
;
}
namespace
MessageViewer
{
...
...
@@ -89,7 +90,6 @@ class OpenAttachmentFolderWidget;
class
HeaderStyleMenuManager
;
class
ViewerPluginToolManager
;
class
ViewerPluginInterface
;
class
ZoomActionMenu
;
/**
\brief Private class for the Viewer, the main widget in the messageviewer library.
...
...
@@ -681,7 +681,7 @@ public:
MessageViewer
::
HeaderStylePlugin
*
mHeaderStylePlugin
;
MessageViewer
::
HeaderStyleMenuManager
*
mHeaderStyleMenuManager
;
MessageViewer
::
ViewerPluginToolManager
*
mViewerPluginToolManager
;
Messag
eViewer
::
ZoomActionMenu
*
mZoomActionMenu
;
WebEngin
eViewer
::
ZoomActionMenu
*
mZoomActionMenu
;
};
}
...
...
webengineviewer/src/CMakeLists.txt
View file @
99607506
...
...
@@ -28,8 +28,12 @@ set(libwebengineviewer_webengine_SRCS
)
set
(
libwebengineviewer_findbar_SRCS
findbar/findbarbase.cpp
findbar/findbarwebengineview.cpp
findbar/findbarbase.cpp
findbar/findbarwebengineview.cpp
)
set
(
libwebengineviewer_widgets_SRCS
widgets/zoomactionmenu.cpp
)
...
...
@@ -38,6 +42,7 @@ set(libmessageviewer_web_LIB Qt5::WebEngineWidgets )
set
(
libwebengineviewer_SRCS
${
libwebengineviewer_webengine_SRCS
}
${
libwebengineviewer_findbar_SRCS
}
${
libwebengineviewer_widgets_SRCS
}
)
qt5_add_resources
(
libwebengineviewer_webengine_SRCS jquery.qrc
)
...
...
@@ -122,6 +127,16 @@ ecm_generate_headers(WebEngineViewer_Camelcasewebengine_misc_HEADERS
RELATIVE
)
ecm_generate_headers
(
WebEngineViewer_Camelcasewidgets_HEADERS
HEADER_NAMES
ZoomActionMenu
REQUIRED_HEADERS WebEngineViewer_widgets_HEADERS
PREFIX WebEngineViewer
RELATIVE widgets
)
ecm_generate_pri_file
(
BASE_NAME WebEngineViewer
LIB_NAME KF5WebEngineViewer
DEPS
""
FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/WebEngineViewer
...
...
@@ -134,6 +149,7 @@ install(FILES
${
WebEngineViewer_Camelcasewebengine_manager_HEADERS
}
${
WebEngineViewer_Camelcasewebengine_misc_HEADERS
}
${
WebEngineViewer_Camelfindbar_HEADERS
}
${
WebEngineViewer_Camelcasewidgets_HEADERS
}
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/WebEngineViewer
COMPONENT Devel
)
...
...
@@ -144,6 +160,7 @@ install(FILES
${
WebEngineViewer_webengine_urlinterceptor_HEADERS
}
${
WebEngineViewer_webengine_manager_HEADERS
}
${
WebEngineViewer_webengine_misc_HEADERS
}
${
WebEngineViewer_widgets_HEADERS
}
${
CMAKE_CURRENT_BINARY_DIR
}
/webengineviewer_export.h
DESTINATION
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/webengineviewer
COMPONENT Devel
...
...
webengineviewer/src/autotests/CMakeLists.txt
View file @
99607506
...
...
@@ -5,3 +5,9 @@ ecm_add_test(webhittestresulttest.cpp ../webhittestresult.cpp
)
ecm_add_test
(
zoomactionmenutest.cpp
TEST_NAME zoomactionmenutest
NAME_PREFIX
"webengineviewer-"
LINK_LIBRARIES Qt5::Test KF5::WebEngineViewer KF5::XmlGui
)
webengineviewer/src/autotests/zoomactionmenutest.cpp
0 → 100644
View file @
99607506
/*
Copyright (c) 2015-2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "zoomactionmenutest.h"
#include "../widgets/zoomactionmenu.h"
#include <QTest>
#include <KActionCollection>
ZoomActionMenuTest
::
ZoomActionMenuTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
ZoomActionMenuTest
::~
ZoomActionMenuTest
()
{
}
void
ZoomActionMenuTest
::
shouldHaveDefaultValue
()
{
WebEngineViewer
::
ZoomActionMenu
menu
(
this
);
menu
.
setActionCollection
(
new
KActionCollection
(
this
));
menu
.
createZoomActions
();
QVERIFY
(
menu
.
zoomInAction
());
QVERIFY
(
menu
.
zoomOutAction
());
QVERIFY
(
menu
.
zoomResetAction
());
}
void
ZoomActionMenuTest
::
shouldAssignZoomFactor
()
{
WebEngineViewer
::
ZoomActionMenu
menu
(
this
);
menu
.
setActionCollection
(
new
KActionCollection
(
this
));
menu
.
createZoomActions
();
qreal
initialValue
=
50
;
menu
.
setZoomFactor
(
initialValue
);
QCOMPARE
(
menu
.
zoomFactor
(),
initialValue
);
}
QTEST_MAIN
(
ZoomActionMenuTest
)
webengineviewer/src/autotests/zoomactionmenutest.h
0 → 100644
View file @
99607506
/*
Copyright (c) 2015-2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ZOOMACTIONMENUTEST_H
#define ZOOMACTIONMENUTEST_H
#include <QObject>
class
ZoomActionMenuTest
:
public
QObject
{
Q_OBJECT
public:
explicit
ZoomActionMenuTest
(
QObject
*
parent
=
Q_NULLPTR
);
~
ZoomActionMenuTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
void
shouldAssignZoomFactor
();
};
#endif // ZOOMACTIONMENUTEST_H
messag
eviewer/src/widgets/zoomactionmenu.cpp
→
webengin
eviewer/src/widgets/zoomactionmenu.cpp
View file @
99607506
...
...
@@ -16,12 +16,11 @@
*/
#include "zoomactionmenu.h"
#include "config-messageviewer.h"
#include <KLocalizedString>
#include <KToggleAction>
#include <KActionCollection>
using
namespace
Messag
eViewer
;
using
namespace
WebEngin
eViewer
;
namespace
{
qreal
zoomBy
()
...
...
@@ -30,7 +29,7 @@ qreal zoomBy()
}
}
class
Messag
eViewer
::
ZoomActionMenuPrivate
class
WebEngin
eViewer
::
ZoomActionMenuPrivate
{
public:
ZoomActionMenuPrivate
(
KActionMenu
*
qq
)
...
...
@@ -54,7 +53,7 @@ public:
ZoomActionMenu
::
ZoomActionMenu
(
QObject
*
parent
)
:
KActionMenu
(
parent
),
d
(
new
Messag
eViewer
::
ZoomActionMenuPrivate
(
this
))
d
(
new
WebEngin
eViewer
::
ZoomActionMenuPrivate
(
this
))
{
}
...
...
messag
eviewer/src/widgets/zoomactionmenu.h
→
webengin
eviewer/src/widgets/zoomactionmenu.h
View file @
99607506
...
...
@@ -15,17 +15,17 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ZOOMACTIONMENU_H
#define ZOOMACTIONMENU_H
#ifndef
WEBENGINE
ZOOMACTIONMENU_H
#define
WEBENGINE
ZOOMACTIONMENU_H
#include <KActionMenu>
#include "
messag
eviewer_export.h"
#include "
webengin
eviewer_export.h"
class
KToggleAction
;
class
KActionCollection
;
namespace
Messag
eViewer
namespace
WebEngin
eViewer
{
class
ZoomActionMenuPrivate
;
class
MESSAG
EVIEWER_EXPORT
ZoomActionMenu
:
public
KActionMenu
class
WEBENGIN
EVIEWER_EXPORT
ZoomActionMenu
:
public
KActionMenu
{
Q_OBJECT
public:
...
...
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