From cdacdd9bc49b72484f5499199ca69e686a189900 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 27 Mar 2016 18:18:53 +0000 Subject: [PATCH] kutils: allow multiple options to be passed to the KMediaWidget constructor and make use of it in KHTML Signed-off-by: Ivailo Monev --- khtml/html/HTMLMediaElement.cpp | 2 +- kutils/kmediaplayer/kmediawidget.h | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/khtml/html/HTMLMediaElement.cpp b/khtml/html/HTMLMediaElement.cpp index 38842fb8..e6b43879 100644 --- a/khtml/html/HTMLMediaElement.cpp +++ b/khtml/html/HTMLMediaElement.cpp @@ -63,7 +63,7 @@ HTMLMediaElement::HTMLMediaElement(Document* doc) , m_previousProgress(0) , m_previousProgressTime(doubleMax) , m_sentStalledEvent(false) - , m_player(new KMediaWidget(NULL, KMediaWidget::FullscreenVideo)) + , m_player(new KMediaWidget(NULL, KMediaWidget::HiddenControls | KMediaWidget::FullscreenVideo)) { } diff --git a/kutils/kmediaplayer/kmediawidget.h b/kutils/kmediaplayer/kmediawidget.h index 305c3de8..f8f630da 100644 --- a/kutils/kmediaplayer/kmediawidget.h +++ b/kutils/kmediaplayer/kmediawidget.h @@ -55,27 +55,29 @@ class KMEDIAPLAYER_EXPORT KMediaWidget: public QWidget { Q_OBJECT public: - enum KMediaOptions { + enum KMediaOption { //! @brief No options at all NoOptions = 0, /*! - @long When URLs are dragged to the widget it will be opened + @long When URL is dragged to the widget it will be opened */ DragDrop = 1, /*! - @long Provide fullscreen option, it is option because it will ask the parent to do it + @long Provide fullscreen option, it is such because it will ask the parent to do it */ FullscreenVideo = 2, /*! - @long After a certain ammount of time the controls will hide themselfs allowing more - screen space to be taken by the display widget + @long After a certain amount of time the controls will hide themselfs allowing more + screen space to be taken by the video widget */ - HiddenControls = 4, + HiddenControls = 3, //! @brief All available options AllOptions = DragDrop | FullscreenVideo | HiddenControls, //! @brief Default options, currently none DefaultOptions = NoOptions }; + Q_DECLARE_FLAGS(KMediaOptions, KMediaOption); + KMediaWidget(QWidget *parent, KMediaOptions options = DefaultOptions); ~KMediaWidget(); @@ -169,5 +171,6 @@ private: bool m_replay; Ui_KMediaWidgetPrivate *d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(KMediaWidget::KMediaOptions); #endif // KMEDIAWIDGET_H