Update gtk141
This commit is contained in:
parent
485da9b85a
commit
1e5e6e5c24
|
@ -26,7 +26,7 @@ find_package (Gettext REQUIRED)
|
|||
set(PO_DIR ${CMAKE_BINARY_DIR}/po/zh_CN/LC_MESSAGES)
|
||||
|
||||
#Source files
|
||||
set(SOURCE_FILE src/main.cc src/MineSweeper.cc)
|
||||
set(SOURCE_FILE src/main.cc src/MineSweeper.cc src/InputBox.cc)
|
||||
|
||||
#Compile Resource
|
||||
|
||||
|
@ -44,7 +44,8 @@ set(RESOURCE_LIST
|
|||
icons/scalable/status/incorrect.svg
|
||||
icons/scalable/status/maybe.svg
|
||||
icons/scalable/status/mine.svg
|
||||
minesweeper.ui)
|
||||
minesweeper.ui
|
||||
win_input.ui)
|
||||
|
||||
compile_gresources(RESOURCE_FILE
|
||||
XML_OUT
|
||||
|
|
|
@ -2,20 +2,34 @@
|
|||
<!DOCTYPE cambalache-project SYSTEM "cambalache-project.dtd">
|
||||
<cambalache-project version="0.11.2" target_tk="gtk+-3.0">
|
||||
<ui>
|
||||
(1,None,"minesweeper.ui","minesweeper.ui",None,None,None,None,None,None,None)
|
||||
(1,None,"minesweeper.ui","minesweeper.ui",None,None,None,None,None,None,None),
|
||||
(2,None,None,"win_input.ui",None,None,None,None,None,None,None)
|
||||
</ui>
|
||||
<object>
|
||||
(1,1,"GtkWindow","minesweeper",None,None,None,None,None,None),
|
||||
(1,2,"GtkStack","main_stack",1,None,None,None,-1,None),
|
||||
(1,3,"GtkGrid","start_page",2,None,None,None,-1,None),
|
||||
(1,4,"GtkBox","main_page",2,None,None,None,-1,None),
|
||||
(1,5,"GtkGrid","custom_page",2,None,None,None,-1,None)
|
||||
(1,2,"GtkStackSwitcher",None,1,None,"titlebar",None,-1,None),
|
||||
(1,3,"GtkStack","main_stack",1,None,None,None,1,None),
|
||||
(1,4,"GtkGrid","start_page",3,None,None,None,None,None),
|
||||
(1,5,"GtkBox","main_page",3,None,None,None,1,None),
|
||||
(1,6,"GtkGrid","custom_page",3,None,None,None,2,None),
|
||||
(2,1,"GtkDialog",None,None,None,None,None,None,None)
|
||||
</object>
|
||||
<object_property>
|
||||
(1,1,"GtkContainer","resize-mode","queue",None,None,None,None,None),
|
||||
(1,1,"GtkWindow","default-height","400",None,None,None,None,None),
|
||||
(1,1,"GtkWindow","default-width","700",None,None,None,None,None),
|
||||
(1,2,"GtkStack","transition-type","slide-right",None,None,None,None,None),
|
||||
(1,2,"GtkWidget","halign","baseline",None,None,None,None,None)
|
||||
(1,3,"GtkStack","transition-type","slide-right",None,None,None,None,None),
|
||||
(1,3,"GtkWidget","halign","baseline",None,None,None,None,None),
|
||||
(1,4,"GtkGrid","column-homogeneous","True",None,None,None,None,None),
|
||||
(1,4,"GtkGrid","column-spacing","2",None,None,None,None,None),
|
||||
(1,4,"GtkGrid","row-homogeneous","True",None,None,None,None,None),
|
||||
(1,4,"GtkWidget","halign","center",None,None,None,None,None),
|
||||
(1,4,"GtkWidget","valign","center",None,None,None,None,None),
|
||||
(1,5,"GtkOrientable","orientation","vertical",None,None,None,None,None),
|
||||
(2,1,"GtkWidget","expand","True",None,None,None,None,None),
|
||||
(2,1,"GtkWidget","height-request","200",None,None,None,None,None),
|
||||
(2,1,"GtkWidget","margin-start","3",None,None,None,None,None),
|
||||
(2,1,"GtkWidget","width-request","400",None,None,None,None,None),
|
||||
(2,1,"GtkWindow","gravity","center",None,None,None,None,None)
|
||||
</object_property>
|
||||
</cambalache-project>
|
||||
|
|
|
@ -7,15 +7,29 @@
|
|||
<property name="default-height">400</property>
|
||||
<property name="default-width">700</property>
|
||||
<property name="resize-mode">queue</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkStackSwitcher"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="main_stack">
|
||||
<property name="halign">baseline</property>
|
||||
<property name="transition-type">slide-right</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="start_page"/>
|
||||
<object class="GtkGrid" id="start_page">
|
||||
<property name="column-homogeneous">True</property>
|
||||
<property name="column-spacing">2</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="row-homogeneous">True</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="main_page"/>
|
||||
<object class="GtkBox" id="main_page">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="custom_page"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.40.0 -->
|
||||
<!-- Created with Cambalache 0.11.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkDialog">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="type-hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="layout-style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_ok">
|
||||
<property name="label" translatable="yes">OK</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_cancel">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<!-- n-columns=3 n-rows=3 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-5">btn_ok</action-widget>
|
||||
<action-widget response="-6">btn_cancel</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
|
@ -0,0 +1,15 @@
|
|||
#include "InputBox.hh"
|
||||
|
||||
InputBox::InputBox(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &ref_Glade)
|
||||
: Gtk::Dialog(cobject),
|
||||
ref_builder(ref_Glade)
|
||||
{
|
||||
}
|
||||
|
||||
InputBox *InputBox::create()
|
||||
{
|
||||
auto builder = Gtk::Builder::create_from_resource("/org/gtk/daleclack/win_input.ui");
|
||||
|
||||
InputBox *dialog;
|
||||
builder->get_widget_derived("dialog", dialog);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
class InputBox : public Gtk::Dialog{
|
||||
public:
|
||||
static InputBox *create();
|
||||
InputBox(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &ref_Glade);
|
||||
|
||||
private:
|
||||
Glib::RefPtr<Gtk::Builder> ref_builder;
|
||||
};
|
|
@ -238,5 +238,6 @@ void MineSweeper::check_mines(int pos_x, int pos_y)
|
|||
mytimer.disconnect();
|
||||
|
||||
// Save the time of game
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue