mirror of https://github.com/daleclack/My_GtkUi
Put dock upper
This commit is contained in:
parent
fae2d64e0f
commit
457a3aa767
|
@ -2,7 +2,11 @@
|
||||||
#include "Start.h"
|
#include "Start.h"
|
||||||
|
|
||||||
void add_dock(GtkWidget * overlay, GtkStyleProvider * provider){
|
void add_dock(GtkWidget * overlay, GtkStyleProvider * provider){
|
||||||
GtkWidget * dock_box;
|
GtkWidget * dock_box, * main_box;
|
||||||
|
|
||||||
|
//Create a box for layout
|
||||||
|
main_box = gtk_box_new(GTK_ORIENTATION_VERTICAL,5);
|
||||||
|
|
||||||
//Get Widget
|
//Get Widget
|
||||||
GtkBuilder * builder = gtk_builder_new_from_resource("/org/gtk/daleclack/dock.ui");
|
GtkBuilder * builder = gtk_builder_new_from_resource("/org/gtk/daleclack/dock.ui");
|
||||||
dock_box = (GtkWidget*)gtk_builder_get_object(builder,"main_dock");
|
dock_box = (GtkWidget*)gtk_builder_get_object(builder,"main_dock");
|
||||||
|
@ -11,9 +15,14 @@ void add_dock(GtkWidget * overlay, GtkStyleProvider * provider){
|
||||||
add_start(GTK_BOX(dock_box));
|
add_start(GTK_BOX(dock_box));
|
||||||
|
|
||||||
//Put the dock on the overlay
|
//Put the dock on the overlay
|
||||||
gtk_widget_set_halign(dock_box,GTK_ALIGN_CENTER);
|
gtk_box_append(GTK_BOX(main_box),dock_box);
|
||||||
gtk_widget_set_valign(dock_box,GTK_ALIGN_END);
|
gtk_widget_set_halign(main_box,GTK_ALIGN_CENTER);
|
||||||
gtk_overlay_add_overlay(GTK_OVERLAY(overlay),dock_box);
|
gtk_widget_set_valign(main_box,GTK_ALIGN_END);
|
||||||
|
gtk_overlay_add_overlay(GTK_OVERLAY(overlay),main_box);
|
||||||
|
|
||||||
|
//Add a separator
|
||||||
|
GtkWidget * space = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
|
||||||
|
gtk_box_append(GTK_BOX(main_box),space);
|
||||||
|
|
||||||
//Set Style
|
//Set Style
|
||||||
gtk_style_context_add_provider(gtk_widget_get_style_context(dock_box), provider, G_MAXINT);
|
gtk_style_context_add_provider(gtk_widget_get_style_context(dock_box), provider, G_MAXINT);
|
||||||
|
|
Loading…
Reference in New Issue