|
|
@@ -1,10 +1,13 @@
|
|
|
-#include <gtkmm.h>
|
|
|
+#include <gtkmm/widget.h>
|
|
|
+#include <gtkmm/button.h>
|
|
|
+#include <gtkmm/window.h>
|
|
|
+#include <gtkmm/box.h>
|
|
|
+#include <gtkmm/orientable.h>
|
|
|
#include <iostream>
|
|
|
|
|
|
#include "strings.hpp"
|
|
|
#include "config.hpp"
|
|
|
#include "core_window.hpp"
|
|
|
-#include "buttons.hpp"
|
|
|
|
|
|
namespace cx_light {
|
|
|
|
|
|
@@ -13,56 +16,17 @@ core_window::core_window() {
|
|
|
this->set_default_size(400, 200);
|
|
|
|
|
|
this->init_default();
|
|
|
- this->show_all();
|
|
|
}
|
|
|
|
|
|
core_window::~core_window() {
|
|
|
- delete this->add_light;
|
|
|
- delete this->lights_list;
|
|
|
- delete this->lights_list_frame;
|
|
|
- delete this->content;
|
|
|
+ delete this->center;
|
|
|
}
|
|
|
|
|
|
void core_window::init_default() {
|
|
|
- this->create_lights_list();
|
|
|
-
|
|
|
- this->content = new Gtk::Grid();
|
|
|
- this->content->attach(*this->lights_list_frame, 0, 0);
|
|
|
-
|
|
|
- this->add(*this->content);
|
|
|
-}
|
|
|
-
|
|
|
-void core_window::create_lights_list() {
|
|
|
- this->add_light = new add_light_button();
|
|
|
-
|
|
|
- this->lights_list_frame = new Gtk::Frame();
|
|
|
- this->lights_list_frame->set_label(__(LIGHTS_LIST));
|
|
|
- this->set_margin(this->lights_list_frame, DEFAULT_MARGIN);
|
|
|
-
|
|
|
- this->lights_list = new Gtk::ListBox();
|
|
|
- this->set_margin(this->lights_list, DEFAULT_MARGIN);
|
|
|
-
|
|
|
- this->lights_list_frame->add(*this->lights_list);
|
|
|
- this->lights_list->append(*this->add_light);
|
|
|
+ this->center = new Gtk::Box();
|
|
|
+ this->center->set_orientation(Gtk::Orientation::HORIZONTAL);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-void core_window::set_margin(Gtk::Widget *target, unsigned int margin) {
|
|
|
- target->set_margin_top(margin);
|
|
|
- target->set_margin_left(margin);
|
|
|
- target->set_margin_right(margin);
|
|
|
- target->set_margin_bottom(margin);
|
|
|
}
|
|
|
|
|
|
-void core_window::set_margin(
|
|
|
- Gtk::Widget *target,
|
|
|
- unsigned int margin_top,
|
|
|
- unsigned int margin_side
|
|
|
-) {
|
|
|
- target->set_margin_top(margin_top);
|
|
|
- target->set_margin_left(margin_side);
|
|
|
- target->set_margin_right(margin_side);
|
|
|
- target->set_margin_bottom(margin_top);
|
|
|
-}
|
|
|
|
|
|
-}
|