Replace title bar for draw app

This commit is contained in:
daleclack 2024-03-23 22:48:14 +08:00
parent df11ea4d11
commit f08409f93e
3 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#pragma once
#include <gtkmm.h>
#include "MyTitleBar.hh"
class CalcApp : public Gtk::Window
{
@ -11,6 +12,7 @@ public:
private:
// Main GtkBuilder
Glib::RefPtr<Gtk::Builder> ref_builder;
MyTitleBar title_bar;
// Calculator Class
int pos;

View File

@ -1,6 +1,7 @@
#pragma once
#include <gtkmm.h>
#include "MyTitleBar.hh"
// 4 Draw modes: default(free draw), circle, line, rectangle
enum class DrawMode{
@ -19,6 +20,9 @@ enum class DrawProcess{
class Drawing : public Gtk::Window
{
// Custom title bar
MyTitleBar title_bar;
// Drawing Mode
DrawMode drawing_mode;

View File

@ -15,7 +15,8 @@ Drawing::Drawing()
{
// Ininalize window
set_icon_name("org.gtk.daleclack");
set_title("Drawing");
title_bar.set_ctrl_win(this);
title_bar.set_title("Drawing");
set_default_size(640, 480);
// Set the buttons grouped and set normal draw mode