Hello,

here a new patch adding a --nooxygen-fix option to disable new tab button hack 
for users not using oxygen as default style...

It should be cool to have such option, don't let non oxygen users wait for a 
fix in oxygen.

Cedric
diff --git a/src/application.cpp b/src/application.cpp
index e93e5b8..1227b6d 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -66,7 +66,7 @@ QPointer<HistoryManager> Application::s_historyManager;
 QPointer<BookmarkProvider> Application::s_bookmarkProvider;
 QPointer<SessionManager> Application::s_sessionManager;
 QPointer<AdBlockManager> Application::s_adblockManager;
-
+bool Application::s_oxygenFix;
 
 Application::Application()
     : KUniqueApplication()
@@ -94,6 +94,8 @@ int Application::newInstance()
     // so initialize only once
     static bool first = true;
     
+    s_oxygenFix = args->isSet("oxygen-fix");
+
     if(args->count() == 0)
     {
         if(first)   // we are starting rekonq, for the first time with no args: use startup behaviour
@@ -243,6 +245,11 @@ SessionManager *Application::sessionManager()
 }
 
 
+bool Application::oxygenFix()
+{
+    return s_oxygenFix;
+}
+
 KIcon Application::icon(const KUrl &url)
 {
     if(!Application::instance()->mainWindowList().isEmpty()) // avoid infinite loop at startup
diff --git a/src/application.h b/src/application.h
index c9fb079..88b3b65 100644
--- a/src/application.h
+++ b/src/application.h
@@ -103,6 +103,8 @@ public:
     
     static KIcon icon(const KUrl &url);
 
+    static bool oxygenFix();
+
     static HistoryManager *historyManager();
     static BookmarkProvider *bookmarkProvider();
     static SessionManager *sessionManager();
@@ -146,6 +148,8 @@ private:
     static QPointer<SessionManager> s_sessionManager;
     static QPointer<AdBlockManager> s_adblockManager;
     
+    static bool s_oxygenFix; 
+
     MainWindowList m_mainWindows;
 };
 
diff --git a/src/main.cpp b/src/main.cpp
index 030b847..edb4106 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -140,6 +140,9 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
     // adding URL option
     options.add("+[URL]" , ki18n("Location to open"));
 
+    // adding oxygen fix disable option
+    options.add("nooxygen-fix" , ki18n("Don't use oxygen style fix for new tabs button"));
+
     // Register the supported options
     KCmdLineArgs::addCmdLineOptions(options);
 
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 953f6f3..ce598c7 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -147,11 +147,16 @@ void MainView::updateTabButtonPosition()
             newPosX = tabWidgetWidth - m_addTabButton->width();
 
         // detecting Y position
-        int newPosY = m_tabBar->height() - m_addTabButton->height();
-        if(newPosY < 0)
-            newPosY = 5;    // this hardcoded value is used in just ONE situation:
-                            // the first time an user changes the "Always Show Tab Bar" settings
-                            // try some better fixes, if you can :D
+        int newPosY;
+        if (Application::oxygenFix ())
+        {
+            newPosY = m_tabBar->height() - m_addTabButton->height();
+            if(newPosY < 0)
+                newPosY = 5;    // this hardcoded value is used in just ONE situation:
+                                // the first time an user changes the "Always Show Tab Bar" settings
+                                // try some better fixes, if you can :D
+        }
+	else newPosY = 0;
 
         m_addTabButton->move(newPosX, newPosY);
     }
_______________________________________________
rekonq mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/rekonq

Reply via email to