From 79ff338a3427a236ef53adf806c56616faa3426c Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Sat, 30 May 2020 02:58:43 +0200 Subject: Initial commit: Basic Gemini client. --- mainwindow.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 mainwindow.cpp (limited to 'mainwindow.cpp') diff --git a/mainwindow.cpp b/mainwindow.cpp new file mode 100644 index 0000000..9e5c3df --- /dev/null +++ b/mainwindow.cpp @@ -0,0 +1,47 @@ +#include "mainwindow.hpp" +#include "ui_mainwindow.h" +#include "browsertab.hpp" + +#include + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow), + url_status(new QLabel()) +{ + ui->setupUi(this); + + this->statusBar()->addWidget(this->url_status); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::addEmptyTab() +{ + auto tab = std::make_unique(this); + + + + this->ui->browser_tabs->addTab(tab.release(), "Page"); +} + +void MainWindow::addNewTab(QUrl const & url) +{ + auto tab = std::make_unique(this); + + tab->navigateTo(url); + + this->ui->browser_tabs->addTab(tab.release(), "Page"); +} + +void MainWindow::setUrlPreview(const QUrl &url) +{ + if(url.isValid()) + this->url_status->setText(url.toString()); + else + this->url_status->setText(""); +} + -- cgit v1.2.3