Load style sheet

This commit is contained in:
lakinduakash 2019-04-17 20:14:19 +05:30
parent 07c494bc43
commit cca2e2f48b
2 changed files with 23 additions and 0 deletions

9
src/ui/glade/style.css Normal file
View File

@ -0,0 +1,9 @@
.enter_button{
background: #ff3f4e;
color: #ffffff;
border-radius: 2px;
}
.enter_button:disabled{
color: #ffffff;
}

View File

@ -7,6 +7,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <regex.h>
#include "h_prop.h" #include "h_prop.h"
#include "ui.h" #include "ui.h"
@ -43,6 +44,10 @@ GtkProgressBar *progress_bar;
GtkLabel *label_status; GtkLabel *label_status;
GtkCssProvider* provider;
GdkDisplay *display;
GdkScreen *screen;
GError *error = NULL; GError *error = NULL;
@ -89,6 +94,15 @@ static void on_stop_hp_clicked(GtkWidget *widget, gpointer data) {
} }
void loadStyles(){
provider = gtk_css_provider_new();
display = gdk_display_get_default();
screen = gdk_display_get_default_screen (display);
gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_USER);
gtk_css_provider_load_from_path(GTK_CSS_PROVIDER(provider),"glade/style.css",NULL);
}
int initUi(int argc, char *argv[]){ int initUi(int argc, char *argv[]){
XInitThreads(); XInitThreads();