mirror of https://github.com/daleclack/My_GtkUi
Add dock expand config
This commit is contained in:
parent
ad9b91da75
commit
e492fb78c9
|
@ -26,6 +26,10 @@
|
||||||
<item>
|
<item>
|
||||||
<attribute name="label">Turn Magnification On</attribute>
|
<attribute name="label">Turn Magnification On</attribute>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Expand</attribute>
|
||||||
|
<attribute name="action">win.expand</attribute>
|
||||||
|
</item>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -33,3 +33,7 @@ void MyStack::logout(){
|
||||||
void MyStack::btnlogin_clicked(){
|
void MyStack::btnlogin_clicked(){
|
||||||
stack->set_visible_child(*main_page);
|
stack->set_visible_child(*main_page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyStack::set_mydock_mode(DockMode mode){
|
||||||
|
main_dock->set_dock_mode(mode);
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ public:
|
||||||
void logout();
|
void logout();
|
||||||
void mystack_init(Gtk::Window *window, Gtk::Image *m_back);
|
void mystack_init(Gtk::Window *window, Gtk::Image *m_back);
|
||||||
void show_prefs();
|
void show_prefs();
|
||||||
|
void set_mydock_mode(DockMode mode);
|
||||||
|
|
||||||
// Main Widget
|
// Main Widget
|
||||||
Gtk::Stack *stack;
|
Gtk::Stack *stack;
|
||||||
|
|
|
@ -23,7 +23,8 @@ MyWin::MyWin()
|
||||||
add_action("logout", sigc::mem_fun(*this, &MyWin::logout_activated));
|
add_action("logout", sigc::mem_fun(*this, &MyWin::logout_activated));
|
||||||
add_action("quit", sigc::mem_fun(*this, &MyWin::quit_activated));
|
add_action("quit", sigc::mem_fun(*this, &MyWin::quit_activated));
|
||||||
add_action("about", sigc::mem_fun(*this, &MyWin::about_activated));
|
add_action("about", sigc::mem_fun(*this, &MyWin::about_activated));
|
||||||
add_action("back", sigc::mem_fun(*this, &MyWin::back_actiavted));
|
add_action("back", sigc::mem_fun(*this, &MyWin::back_activated));
|
||||||
|
add_action("expand",sigc::mem_fun(*this,&MyWin::expand_activated));
|
||||||
|
|
||||||
// Add Stack
|
// Add Stack
|
||||||
m_overlay.set_size_request(width, height);
|
m_overlay.set_size_request(width, height);
|
||||||
|
@ -60,11 +61,15 @@ void MyWin::logout_activated()
|
||||||
main_stack.logout();
|
main_stack.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyWin::back_actiavted()
|
void MyWin::back_activated()
|
||||||
{
|
{
|
||||||
main_stack.show_prefs();
|
main_stack.show_prefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyWin::expand_activated(){
|
||||||
|
main_stack.set_mydock_mode(DockMode::MODE_PANEL);
|
||||||
|
}
|
||||||
|
|
||||||
void MyWin::about_activated()
|
void MyWin::about_activated()
|
||||||
{
|
{
|
||||||
// Authors information
|
// Authors information
|
||||||
|
|
|
@ -25,6 +25,7 @@ private:
|
||||||
void logout_activated();
|
void logout_activated();
|
||||||
void quit_activated();
|
void quit_activated();
|
||||||
void about_activated();
|
void about_activated();
|
||||||
void back_actiavted();
|
void back_activated();
|
||||||
|
void expand_activated();
|
||||||
|
|
||||||
};
|
};
|
|
@ -87,6 +87,18 @@ MyDock::MyDock(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &ref_Gl
|
||||||
show_all_children();
|
show_all_children();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyDock::set_dock_mode(DockMode mode){
|
||||||
|
switch(mode){
|
||||||
|
case DockMode::MODE_DOCK:
|
||||||
|
set_vexpand(false);
|
||||||
|
break;
|
||||||
|
case DockMode::MODE_PANEL:
|
||||||
|
set_vexpand();
|
||||||
|
set_valign(Gtk::ALIGN_FILL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MyDock::apply_style(Gtk::Widget &widget){
|
void MyDock::apply_style(Gtk::Widget &widget){
|
||||||
auto style = widget.get_style_context();
|
auto style = widget.get_style_context();
|
||||||
style->add_provider(provider,G_MAXUINT);
|
style->add_provider(provider,G_MAXUINT);
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
#include "Runner.hh"
|
#include "Runner.hh"
|
||||||
#include "TextEditor.hh"
|
#include "TextEditor.hh"
|
||||||
|
|
||||||
|
enum class DockMode{
|
||||||
|
MODE_DOCK,
|
||||||
|
MODE_PANEL
|
||||||
|
};
|
||||||
|
|
||||||
class MyDock : public Gtk::Box
|
class MyDock : public Gtk::Box
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -17,6 +22,7 @@ public:
|
||||||
static MyDock *create();
|
static MyDock *create();
|
||||||
void btnset_clicked();
|
void btnset_clicked();
|
||||||
void mydock_init(Gtk::Window *window, Gtk::Image *background1);
|
void mydock_init(Gtk::Window *window, Gtk::Image *background1);
|
||||||
|
void set_dock_mode(DockMode mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Child widgets
|
// Child widgets
|
||||||
|
|
Loading…
Reference in New Issue