]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Set the default window size.
authorSoren Stoutner <soren@stoutner.com>
Tue, 29 Mar 2022 00:54:13 +0000 (17:54 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 29 Mar 2022 00:54:13 +0000 (17:54 -0700)
src/BrowserView.ui
src/ui.rc/browser_ui.rc
src/windows/BrowserWindow.cpp
src/windows/BrowserWindow.h

index d78eb203637643e975533f75ef3d422b2129813f..9d7a535b5b942e224563c4a1e2ac9cebe7773293 100644 (file)
     <class>BrowserView</class>
 
     <widget class="QWidget" name="BrowserView">
-        <!-- TODO.  Make this maximized by default. -->
-        <property name="geometry">
-            <rect>
-                <x>0</x>
-                <y>0</y>
-                <width>700</width>
-                <height>500</height>
-            </rect>
-        </property>
-
         <!-- Main widget. -->
         <layout class="QVBoxLayout">
             <!-- Set the spacing between items to 0. -->
index ec7729e04b988f4fa49ccd94cf63401137f9077d..73bf318446360f281bd95fb7e54d65b9e8831eea 100644 (file)
 
     <!-- The navigation toolbar. -->
     <ToolBar name="navigation_toolbar" iconText="icononly"> <text>Navigation Toolbar</text>
-        <Action name="back" />
-        <Action name="forward" />
-        <Action name="refresh" />
-        <Action name="home" />
+        <Action name="go_back" />
+        <Action name="go_forward" />
+        <Action name="view_redisplay" />
+        <Action name="go_home" />
     </ToolBar>
 
     <!-- The URL toolbar. -->
index d83dd69b5e515b12a2baf6fa9cd3e8689ac93d7a..77bb43b021f112e656da12f42dc731bc9815bcf8 100644 (file)
@@ -46,9 +46,13 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     KActionCollection *actionCollectionPointer = this->actionCollection();
 
     // Add the standard actions.
+    QAction *backActionPointer = KStandardAction::back(this, SLOT(back()), actionCollectionPointer);
+    QAction *forwardActionPointer = KStandardAction::forward(this, SLOT(forward()), actionCollectionPointer);
+    KStandardAction::home(this, SLOT(home()), actionCollectionPointer);
     KStandardAction::openNew(this, SLOT(fileNew()), actionCollectionPointer);
     KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollectionPointer);
     KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollectionPointer);
+    KStandardAction::redisplay(this, SLOT(refresh()), actionCollectionPointer);
 
     // Add the custom actions.
     userAgentPrivacyBrowserActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_privacy_browser"));
@@ -67,10 +71,6 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineBingActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_bing"));
     searchEngineYahooActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_yahoo"));
     searchEngineCustomActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_custom"));
-    backActionPointer = actionCollectionPointer->addAction(QStringLiteral("back"));
-    forwardActionPointer = actionCollectionPointer->addAction(QStringLiteral("forward"));
-    refreshActionPointer = actionCollectionPointer->addAction(QStringLiteral("refresh"));
-    homeActionPointer = actionCollectionPointer->addAction(QStringLiteral("home"));
     javaScriptActionPointer = actionCollectionPointer->addAction(QStringLiteral("javascript"));
     domainSettingsActionPointer = actionCollectionPointer->addAction(QStringLiteral("domain_settings"));
 
@@ -126,18 +126,11 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineGoogleActionPointer->setText(i18nc("Search engine", "Google"));
     searchEngineBingActionPointer->setText(i18nc("Search engine", "Bing"));
     searchEngineYahooActionPointer->setText(i18nc("Search engine", "Yahoo"));
-    backActionPointer->setText(i18nc("Back button", "Back"));
-    forwardActionPointer->setText(i18nc("Forward button", "Forward"));
-    refreshActionPointer->setText(i18nc("Refresh button", "Refresh"));
-    homeActionPointer->setText(i18nc("Home button", "Home"));
     javaScriptActionPointer->setText(i18nc("JavaScript button", "JavaScript"));
     domainSettingsActionPointer->setText(i18nc("Domain Settings button", "Domain Settings"));
 
     // Set the action icons.
-    backActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("arrow-left")));
-    forwardActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("arrow-right")));
-    refreshActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
-    homeActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("home")));
+    //refreshActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
     domainSettingsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("network-server-symbolic")));
 
     // Update the on-the-fly menus.
@@ -153,10 +146,6 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     connect(zoomFactorActionPointer, SIGNAL(triggered()), this, SLOT(getZoomFactorFromUser()));
 
     // Connect the URL toolbar actions.
-    connect(backActionPointer, SIGNAL(triggered()), this, SLOT(back()));
-    connect(forwardActionPointer, SIGNAL(triggered()), this, SLOT(forward()));
-    connect(refreshActionPointer, SIGNAL(triggered()), this, SLOT(refresh()));
-    connect(homeActionPointer, SIGNAL(triggered()), this, SLOT(home()));
     connect(javaScriptActionPointer, SIGNAL(triggered()), this, SLOT(toggleJavaScript()));
     connect(domainSettingsActionPointer, SIGNAL(triggered()), this, SLOT(openDomainSettings()));
 
@@ -310,6 +299,12 @@ void BrowserWindow::toggleJavaScript() const
     browserViewPointer->toggleJavaScript();
 }
 
+QSize BrowserWindow::sizeHint() const
+{
+    // Return the default window size.
+    return QSize(1500, 1200);
+}
+
 void BrowserWindow::settingsConfigure()
 {
     // Check to make sure the dialog box isn't already displayed.
index 7fa60500390cbc170dbdeb392ee1e41d234b72fc..4099d8da32ab6dc81df25821d6fefa583bc996b1 100644 (file)
@@ -39,6 +39,9 @@ public:
     // The default constructor.
     BrowserWindow();
 
+    // The public functions.
+    QSize sizeHint() const override;
+
 private Q_SLOTS:
     // The private slots.
     void back() const;
@@ -62,14 +65,11 @@ private Q_SLOTS:
 
 private:
     // The private variables.
-    QAction *backActionPointer;
     BrowserView *browserViewPointer;
     KConfigDialog *configDialogPointer;
     QAction *domainSettingsActionPointer;
     QPalette domainSettingsPalette;
     double currentZoomFactor;
-    QAction *forwardActionPointer;
-    QAction *homeActionPointer;
     QAction *javaScriptActionPointer;
     QPalette noDomainSettingsPalette;
     QLabel *searchEngineLabelPointer;
@@ -80,7 +80,6 @@ private:
     QAction *searchEngineBingActionPointer;
     QAction *searchEngineYahooActionPointer;
     QAction *searchEngineCustomActionPointer;
-    QAction *refreshActionPointer;
     QLabel *userAgentLabelPointer;
     QAction *userAgentPrivacyBrowserActionPointer;
     QAction *userAgentFirefoxLinuxActionPointer;