roundabout,
created on Friday, 14 March 2025, 20:47:45 (1741985265),
received on Friday, 14 March 2025, 20:47:56 (1741985276)
Author identity: vlad <vlad.muntoiu@gmail.com>
61a6afcd3aea5127d7cd2e0d2d5255bbcdba3708
gpanthera.cc
@@ -474,6 +474,9 @@ namespace gPanthera {
// Clear the old buttons auto old_buttons = collect_children(*this); for(auto *button : old_buttons) { if(auto *button_button = dynamic_cast<Gtk::Button*>(button)) { button_button->unset_child(); }remove(*button); } ContentTab* first_child = nullptr;
@@ -517,6 +520,14 @@ namespace gPanthera {
page->get_stack()->set_visible_child(*page); update_active_style(); }); // Switch tabs on depress auto gesture_click = Gtk::GestureClick::create(); gesture_click->set_button(1); this->add_controller(gesture_click); gesture_click->signal_pressed().connect([this, page](int num_presses, double x, double y) { page->get_stack()->set_visible_child(*page); update_active_style(); });// Provide the drag data drag_source->signal_prepare().connect([this](double, double) { drag_source->set_actions(Gdk::DragAction::MOVE);
@@ -560,7 +571,7 @@ namespace gPanthera {
this->last_stack->remove(*this); } this->last_stack = stack; this->stack->add(*this, this->get_child()->get_name());this->stack->add(*this);} Gtk::Widget *ContentPage::get_child() const {
@@ -569,13 +580,16 @@ namespace gPanthera {
ContentPage::ContentPage(std::shared_ptr<ContentManager> content_manager, ContentStack *stack, Gtk::Widget *child, Gtk::Widget *tab_widget) : Gtk::Box(Gtk::Orientation::VERTICAL, 0), content_manager(std::move(content_manager)), stack(stack), child(child), tab_widget(tab_widget) { this->content_manager->add_stack(this->stack);this->append(*child); this->set_tab_widget(tab_widget); this->set_margin_top(0); this->set_margin_bottom(0); this->set_margin_start(0); this->set_margin_end(0); if(stack) { this->content_manager->add_stack(this->stack); this->stack->add_page(*this); }} ContentManager::ContentManager() : Glib::ObjectBase("ContentManager") {
panthera-www.cc
@@ -56,12 +56,15 @@ protected:
auto content_manager = std::make_shared<gPanthera::ContentManager>(); auto content_stack = Gtk::make_managed<gPanthera::ContentStack>(content_manager); auto content_stack_switcher = Gtk::make_managed<gPanthera::ContentTabBar>(content_stack, Gtk::Orientation::HORIZONTAL); content_manager->add_stack(content_stack);content->append(*content_stack_switcher); content->append(*content_stack); auto page_1_content = Gtk::make_managed<Gtk::Label>("Page 1..."); auto page_1_tab = Gtk::make_managed<Gtk::Label>("Page 1");auto page_1_tab = new Gtk::Label("Page 1");auto page_1 = Gtk::make_managed<gPanthera::ContentPage>(content_manager, content_stack, page_1_content, page_1_tab); content_stack->add_page(*page_1);auto page_2_content = Gtk::make_managed<Gtk::Label>("Page 2..."); auto page_2_tab = new Gtk::Label("Page 2"); auto page_2 = Gtk::make_managed<gPanthera::ContentPage>(content_manager, content_stack, page_2_content, page_2_tab);inner_paned->set_start_child(*content); inner_paned->set_end_child(*dock_stack_1); outer_paned->set_end_child(*inner_paned);