Commit 6b6feae6 authored by Moritz Sokoll's avatar Moritz Sokoll 💬
Browse files

tried fixing weird bugs with gtk

parent 0e7d1531
Pipeline #207 passed with stages
in 4 minutes and 9 seconds
......@@ -12,7 +12,7 @@ cache:
build:
stage: build
script:
- mkdir bin
- mkdir -p bin
- make
- make debug-build
artifacts:
......
#ifndef GWEBB_VALUES_H
#define GWEBB_VALUES_H
extern const char* GWEBB_VERSION_STR;
extern const char* GWEBB_HELP_STR;
namespace libgweb {
extern const char* GWEBB_VERSION_STR;
extern const char* GWEBB_HELP_STR;
}
#endif
......@@ -18,12 +18,12 @@ int main(int argc, char* argv[]) {
for (int i=0; i<argc; i++) {
string arg = argv[i];
if (arg == (string) "-v" || arg== (string) "--version") {
printf("GWebB Version: %s\n", GWEBB_VERSION_STR);
printf("GWebB Version: %s\n", libgweb::GWEBB_VERSION_STR);
gui = false;
}
else if (arg == (string) "-h" || arg == (string) "--help") {
printf("%s\n", GWEBB_HELP_STR);
printf("%s\n", libgweb::GWEBB_HELP_STR);
gui = false;
}
}
......
......@@ -12,21 +12,25 @@ void libgweb::changeTabTitle(GtkWidget *webview, gpointer data) {
int libgweb::createTab(GtkNotebook *notebook, const char* uri, const char* title) {
//TODO: add all Widgets
GtkWidget *webview, *grid, *uribar;
GtkWidget *webview, *grid, *uribar, *backbtn, *forwardbtn, *reloadbtn;
webview = webkit_web_view_new();
uribar = gtk_entry_new();
backbtn = gtk_button_new_from_icon_name("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR);
forwardbtn = gtk_button_new_from_icon_name("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR);
reloadbtn = gtk_button_new_from_icon_name("view-refresh", GTK_ICON_SIZE_SMALL_TOOLBAR);
//TODO: Implement grid for all widgets
grid = gtk_grid_new();
//append children
gtk_grid_attach(GTK_GRID(grid), uribar, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid), webview, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid), uribar, 3, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid), webview, 0, 1, 3, 1);
gtk_grid_attach(GTK_GRID(grid), backbtn, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid), forwardbtn, 0, 1, 1, 1);
gtk_grid_attach(GTK_GRID(grid), reloadbtn, 0, 2, 1, 1);
gtk_grid_set_baseline_row(GTK_GRID(grid), 0);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(webview), uri);
int nbstat = gtk_notebook_append_page(GTK_NOTEBOOK(notebook), grid, gtk_label_new(title));
g_signal_connect(G_OBJECT(webview), "notify::title", G_CALLBACK(changeTabTitle), (gpointer ) notebook);
......
#include "lib/values.hpp"
const char* GWEBB_VERSION_STR = "0.0.1";
const char* GWEBB_HELP_STR = "Usage: gwebb [option] [url]\n"
const char* libgweb::GWEBB_VERSION_STR = "0.0.1";
const char* libgweb::GWEBB_HELP_STR = "Usage: gwebb [option] [url]\n"
"Options:\n"
"-v, --version: prints the version and exits\n"
"-h, --help: prints this help message\n";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment