mirror of https://github.com/daleclack/My_GtkUi
Remove illegal enumerations for gtk4
This commit is contained in:
parent
dacf089ef3
commit
1143e0921e
|
@ -43,25 +43,25 @@ Drawing::Drawing()
|
|||
btn_rectangle.signal_clicked().connect(sigc::mem_fun(*this, &Drawing::btnrectangle_clicked));
|
||||
|
||||
// Left Panel
|
||||
left_box.append(btn_free, Gtk::PACK_SHRINK);
|
||||
left_box.append(btn_circle, Gtk::PACK_SHRINK);
|
||||
left_box.append(btn_line, Gtk::PACK_SHRINK);
|
||||
left_box.append(btn_rectangle, Gtk::PACK_SHRINK);
|
||||
left_box.set_valign(Gtk::ALIGN_START);
|
||||
left_box.append(btn_free);
|
||||
left_box.append(btn_circle);
|
||||
left_box.append(btn_line);
|
||||
left_box.append(btn_rectangle);
|
||||
left_box.set_valign(Gtk::Align::START);
|
||||
|
||||
// Color set panel
|
||||
size_adj = Gtk::Adjustment::create(3.0, 1.0, 20.0);
|
||||
scale.set_adjustment(size_adj);
|
||||
scale.set_value_pos(Gtk::POS_BOTTOM);
|
||||
btn_box.append(fill_check, Gtk::PACK_SHRINK);
|
||||
btn_box.append(fill_btn, Gtk::PACK_SHRINK);
|
||||
btn_box.append(main_label, Gtk::PACK_SHRINK);
|
||||
btn_box.append(color_btn, Gtk::PACK_SHRINK);
|
||||
btn_box.append(size_label, Gtk::PACK_SHRINK);
|
||||
btn_box.append(scale, Gtk::PACK_SHRINK);
|
||||
btn_box.append(btn_save, Gtk::PACK_SHRINK);
|
||||
btn_box.append(btn_clear, Gtk::PACK_SHRINK);
|
||||
btn_box.append(btn_exit, Gtk::PACK_SHRINK);
|
||||
btn_box.append(fill_check);
|
||||
btn_box.append(fill_btn);
|
||||
btn_box.append(main_label);
|
||||
btn_box.append(color_btn);
|
||||
btn_box.append(size_label);
|
||||
btn_box.append(scale);
|
||||
btn_box.append(btn_save);
|
||||
btn_box.append(btn_clear);
|
||||
btn_box.append(btn_exit);
|
||||
btn_box.set_halign(Gtk::ALIGN_CENTER);
|
||||
btn_box.set_valign(Gtk::ALIGN_CENTER);
|
||||
|
||||
|
@ -109,7 +109,7 @@ Drawing::Drawing()
|
|||
draw_area.signal_draw().connect(sigc::mem_fun(*this, &Drawing::draw_event));
|
||||
main_box.append(left_box);
|
||||
main_box.append(draw_area);
|
||||
main_box.append(btn_box, Gtk::PACK_SHRINK);
|
||||
main_box.append(btn_box);
|
||||
main_box.set_border_width(10);
|
||||
add(main_box);
|
||||
show_all_children();
|
||||
|
|
|
@ -24,8 +24,8 @@ ImageApp::ImageApp()
|
|||
// Add control widgets
|
||||
btnopen.set_relief(Gtk::RELIEF_NONE);
|
||||
btnbox.append(scale);
|
||||
btnbox.append(btnopen, Gtk::PACK_SHRINK);
|
||||
main_box.append(btnbox, Gtk::PACK_SHRINK);
|
||||
btnbox.append(btnopen);
|
||||
main_box.append(btnbox);
|
||||
btnopen.signal_clicked().connect(sigc::mem_fun(*this, &ImageApp::btnopen_clicked));
|
||||
|
||||
// Add Drag Gesture
|
||||
|
|
|
@ -35,9 +35,9 @@ MineSweeper::MineSweeper()
|
|||
btnstart.set_label("Start/Reset");
|
||||
btnshow.set_label("Show All");
|
||||
btnexit.set_label("Exit");
|
||||
btn_box.append(btnstart, Gtk::PACK_SHRINK);
|
||||
btn_box.append(btnshow, Gtk::PACK_SHRINK);
|
||||
btn_box.append(btnexit, Gtk::PACK_SHRINK);
|
||||
btn_box.append(btnstart);
|
||||
btn_box.append(btnshow);
|
||||
btn_box.append(btnexit);
|
||||
btnstart.signal_clicked().connect(sigc::mem_fun(*this, &MineSweeper::new_game));
|
||||
btnshow.signal_clicked().connect(sigc::mem_fun(*this, &MineSweeper::show_mines));
|
||||
btnexit.signal_clicked().connect(sigc::mem_fun(*this, &MineSweeper::hide));
|
||||
|
@ -46,9 +46,9 @@ MineSweeper::MineSweeper()
|
|||
status_label.set_halign(Gtk::ALIGN_CENTER);
|
||||
btn_box.set_halign(Gtk::ALIGN_CENTER);
|
||||
mine_grid.set_halign(Gtk::ALIGN_CENTER);
|
||||
main_box.append(status_label, Gtk::PACK_SHRINK);
|
||||
main_box.append(status_label);
|
||||
main_box.append(mine_grid);
|
||||
main_box.append(btn_box, Gtk::PACK_SHRINK);
|
||||
main_box.append(btn_box);
|
||||
|
||||
// Create a dialog
|
||||
input_dialog = InputBox::create();
|
||||
|
|
|
@ -16,8 +16,8 @@ GtkRunner::GtkRunner() : hbox(Gtk::Orientation::HORIZONTAL, 5),
|
|||
// Initalize Box
|
||||
hbox.set_halign(Gtk::ALIGN_CENTER);
|
||||
hbox.set_valign(Gtk::ALIGN_CENTER);
|
||||
hbox.append(app_entry, Gtk::PACK_SHRINK);
|
||||
hbox.append(open_btn, Gtk::PACK_SHRINK);
|
||||
hbox.append(app_entry);
|
||||
hbox.append(open_btn);
|
||||
|
||||
// Initalize entry
|
||||
app_entry.set_activates_default();
|
||||
|
|
|
@ -76,18 +76,18 @@ TextEditor::TextEditor()
|
|||
search_down.signal_clicked().connect(sigc::mem_fun(*this, &TextEditor::search_forward));
|
||||
|
||||
// Pack widgets
|
||||
searchbox.append(search_entry, Gtk::PACK_SHRINK);
|
||||
searchbox.append(search_up, Gtk::PACK_SHRINK);
|
||||
searchbox.append(search_down, Gtk::PACK_SHRINK);
|
||||
searchbox.append(search_entry);
|
||||
searchbox.append(search_up);
|
||||
searchbox.append(search_down);
|
||||
searchbar.add(searchbox);
|
||||
vbox.append(searchbar, Gtk::PACK_SHRINK);
|
||||
vbox.append(searchbar);
|
||||
|
||||
// A InfoBar
|
||||
infobar.add_button("OK", Gtk::RESPONSE_OK);
|
||||
infobar.signal_response().connect(sigc::mem_fun(*this, &TextEditor::infobar_response));
|
||||
infobox = dynamic_cast<Gtk::Box *>(infobar.get_content_area());
|
||||
infobox->append(label1);
|
||||
vbox.append(infobar, Gtk::PACK_SHRINK);
|
||||
vbox.append(infobar);
|
||||
vbox.append(hbox);
|
||||
|
||||
// Save config when the window is closed
|
||||
|
@ -100,7 +100,7 @@ TextEditor::TextEditor()
|
|||
expend_builder->get_widget("btn_caps", btncaps);
|
||||
expend_builder->get_widget("btntab", btntab);
|
||||
expend_builder->get_widget("btnenter", btnenter);
|
||||
vbox.append(*expender, Gtk::PACK_SHRINK);
|
||||
vbox.append(*expender);
|
||||
|
||||
// Get alphabet buttons
|
||||
for(int i = 0; i < 26; i++){
|
||||
|
|
|
@ -11,53 +11,53 @@ MyFinder::MyFinder()
|
|||
btnlogo.set_relief(Gtk::RELIEF_NONE);
|
||||
btnlogo.set_use_popover(false);
|
||||
btnlogo.set_menu_model(get_menu(menubuilder, "main_menu"));
|
||||
append(btnlogo, Gtk::PACK_SHRINK);
|
||||
append(btnlogo);
|
||||
|
||||
btntitle.set_label("MyFinder");
|
||||
btntitle.set_relief(Gtk::RELIEF_NONE);
|
||||
btntitle.set_use_popover(false);
|
||||
btntitle.set_menu_model(get_menu(menubuilder, "title_menu"));
|
||||
append(btntitle, Gtk::PACK_SHRINK);
|
||||
append(btntitle);
|
||||
|
||||
btnfile.set_label("File");
|
||||
btnfile.set_relief(Gtk::RELIEF_NONE);
|
||||
btnfile.set_use_popover(false);
|
||||
btnfile.set_menu_model(get_menu(menubuilder, "menu_file"));
|
||||
append(btnfile, Gtk::PACK_SHRINK);
|
||||
append(btnfile);
|
||||
|
||||
btnedit.set_label("Edit");
|
||||
btnedit.set_relief(Gtk::RELIEF_NONE);
|
||||
btnedit.set_use_popover(false);
|
||||
btnedit.set_menu_model(get_menu(menubuilder, "menu_edit"));
|
||||
append(btnedit, Gtk::PACK_SHRINK);
|
||||
append(btnedit);
|
||||
|
||||
btnshow.set_label("Show");
|
||||
btnshow.set_relief(Gtk::RELIEF_NONE);
|
||||
btnshow.set_use_popover(false);
|
||||
btnshow.set_menu_model(get_menu(menubuilder, "menu_show"));
|
||||
append(btnshow, Gtk::PACK_SHRINK);
|
||||
append(btnshow);
|
||||
|
||||
btngoto.set_label("Go to");
|
||||
btngoto.set_relief(Gtk::RELIEF_NONE);
|
||||
btngoto.set_use_popover(false);
|
||||
btngoto.set_menu_model(get_menu(menubuilder, "menu_goto"));
|
||||
append(btngoto, Gtk::PACK_SHRINK);
|
||||
append(btngoto);
|
||||
|
||||
btnwin.set_label("Windows");
|
||||
btnwin.set_relief(Gtk::RELIEF_NONE);
|
||||
btnwin.set_use_popover(false);
|
||||
btnwin.set_menu_model(get_menu(menubuilder, "menu_win"));
|
||||
append(btnwin, Gtk::PACK_SHRINK);
|
||||
append(btnwin);
|
||||
|
||||
btnhelp.set_label("Help");
|
||||
btnhelp.set_relief(Gtk::RELIEF_NONE);
|
||||
btnhelp.set_use_popover(false);
|
||||
btnhelp.set_menu_model(get_menu(menubuilder, "menu_help"));
|
||||
append(btnhelp, Gtk::PACK_SHRINK);
|
||||
append(btnhelp);
|
||||
|
||||
// Add menu to window
|
||||
set_halign(Gtk::ALIGN_FILL);
|
||||
set_valign(Gtk::ALIGN_START);
|
||||
set_valign(Gtk::Align::START);
|
||||
|
||||
// Add a timer
|
||||
time_popover.add(calender);
|
||||
|
@ -70,40 +70,40 @@ MyFinder::MyFinder()
|
|||
// Menu button
|
||||
menu_button.set_image_from_icon_name("open-menu");
|
||||
menu_button.set_relief(Gtk::RELIEF_NONE);
|
||||
pack_end(menu_button, Gtk::PACK_SHRINK);
|
||||
pack_end(menu_button);
|
||||
|
||||
// Find Button
|
||||
find_button.set_image_from_icon_name("finder-find");
|
||||
find_button.set_relief(Gtk::RELIEF_NONE);
|
||||
pack_end(find_button, Gtk::PACK_SHRINK);
|
||||
pack_end(find_button);
|
||||
|
||||
// Timer
|
||||
timer_button.set_label("2022/1/23 18:32");
|
||||
timer_button.set_relief(Gtk::RELIEF_NONE);
|
||||
timer_button.set_popover(time_popover);
|
||||
pack_end(timer_button, Gtk::PACK_SHRINK);
|
||||
pack_end(timer_button);
|
||||
|
||||
mytimer = Glib::signal_timeout().connect(sigc::mem_fun(*this, &MyFinder::time_out), 1000);
|
||||
|
||||
// finder-battery Button
|
||||
battery_button.set_image_from_icon_name("finder-battery");
|
||||
battery_button.set_relief(Gtk::RELIEF_NONE);
|
||||
pack_end(battery_button, Gtk::PACK_SHRINK);
|
||||
pack_end(battery_button);
|
||||
|
||||
// NetWork Button
|
||||
network_button.set_image_from_icon_name("finder-wifi");
|
||||
network_button.set_relief(Gtk::RELIEF_NONE);
|
||||
pack_end(network_button, Gtk::PACK_SHRINK);
|
||||
pack_end(network_button);
|
||||
|
||||
// Audio Button
|
||||
audio_button.set_image_from_icon_name("finder_audio");
|
||||
audio_button.set_relief(Gtk::RELIEF_NONE);
|
||||
pack_end(audio_button, Gtk::PACK_SHRINK);
|
||||
pack_end(audio_button);
|
||||
|
||||
// Monitor Button
|
||||
screen_button.set_image_from_icon_name("finder-computer");
|
||||
screen_button.set_relief(Gtk::RELIEF_NONE);
|
||||
pack_end(screen_button, Gtk::PACK_SHRINK);
|
||||
pack_end(screen_button);
|
||||
|
||||
// Add Style for MyFinder
|
||||
provider = Gtk::CssProvider::create();
|
||||
|
|
|
@ -107,9 +107,9 @@ MyPrefs::MyPrefs()
|
|||
btnadd.signal_clicked().connect(sigc::mem_fun(*this, &MyPrefs::btnadd_clicked));
|
||||
btnremove.set_image_from_icon_name("list-remove");
|
||||
btnremove.signal_clicked().connect(sigc::mem_fun(*this, &MyPrefs::btnremove_clicked));
|
||||
btnbox.append(btnadd, Gtk::PACK_SHRINK);
|
||||
btnbox.append(btnremove, Gtk::PACK_SHRINK);
|
||||
main_box.append(btnbox, Gtk::PACK_SHRINK);
|
||||
btnbox.append(btnadd);
|
||||
btnbox.append(btnremove);
|
||||
main_box.append(btnbox);
|
||||
|
||||
// Add Main Box to window
|
||||
const int margin_value = 15;
|
||||
|
|
Loading…
Reference in New Issue