[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kexi] src/main: Add social buttons to Kexi menu
From:       Adam Pigg <null () kde ! org>
Date:       2018-01-30 21:10:06
Message-ID: E1egdAM-0005NX-My () code ! kde ! org
[Download RAW message or body]

Git commit a31f87c72a74cd32f2020021583b2ccb939abc45 by Adam Pigg.
Committed on 30/01/2018 at 21:09.
Pushed by piggz into branch 'master'.

Add social buttons to Kexi menu

Summary: Add links to FB and Twitter to the Kexi menu

Test Plan: Click buttons, correct link opens

Reviewers: staniek

Reviewed By: staniek

Tags: #kexi

Maniphest Tasks: T7833

Differential Revision: https://phabricator.kde.org/D10194

M  +37   -1    src/main/KexiMainWindow_p.cpp

https://commits.kde.org/kexi/a31f87c72a74cd32f2020021583b2ccb939abc45

diff --git a/src/main/KexiMainWindow_p.cpp b/src/main/KexiMainWindow_p.cpp
index 4bfea5d61..44ec302ee 100644
--- a/src/main/KexiMainWindow_p.cpp
+++ b/src/main/KexiMainWindow_p.cpp
@@ -22,6 +22,7 @@
 
 #include <QPainter>
 #include <QDebug>
+#include <QDesktopServices>
 
 #include <KDbUtils>
 
@@ -237,8 +238,14 @@ void KexiMainMenu::showEvent(QShowEvent * event)
         m_initialized = true;
         KActionCollection *ac = KexiMainWindowIface::global()->actionCollection();
         QHBoxLayout *hlyr = new QHBoxLayout(this);
+        QVBoxLayout *vlyr = new QVBoxLayout(this);
+
         hlyr->setSpacing(0);
         hlyr->setMargin(0);
+
+        vlyr->setSpacing(0);
+        vlyr->setMargin(0);
+
         m_menuWidget = new KexiMenuWidget;
 //! @todo KEXI3 is KexiMenuWidgetStyle needed?
 #if 0
@@ -269,7 +276,36 @@ void KexiMainMenu::showEvent(QShowEvent * event)
 #endif
         m_menuWidget->addSeparator();
         m_menuWidget->addAction(ac->action("quit"));
-        hlyr->addWidget(m_menuWidget);
+        vlyr->addWidget(m_menuWidget, 1);
+
+        //social media section
+        QHBoxLayout *socialLayout = new QHBoxLayout(this);
+        socialLayout->setMargin(2);
+        QLabel *followUs = new QLabel(xi18n("Follow us on "), this);
+
+        socialLayout->addWidget(followUs);
+        socialLayout->addStretch();
+
+        QPushButton *fbButton  = new QPushButton(this);
+        fbButton->setIcon(KexiIcon("im-facebook"));
+        fbButton->setFlat(true);
+        connect(fbButton, &QPushButton::clicked, [](){
+         QDesktopServices::openUrl(QUrl("https://www.facebook.com/kexi.project"));
+        });
+
+        QPushButton *twButton  = new QPushButton(this);
+        twButton->setIcon(KexiIcon("im-twitter"));
+        twButton->setFlat(true);
+        connect(twButton, &QPushButton::clicked, [](){
+         QDesktopServices::openUrl(QUrl("https://twitter.com/kexi_project"));
+        });
+
+        socialLayout->addWidget(fbButton);
+        socialLayout->addWidget(twButton);
+
+        vlyr->addLayout(socialLayout);
+
+        hlyr->addLayout(vlyr);
         m_content = new EmptyMenuContentWidget;
         m_content->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
         m_content->installEventFilter(this);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic