Archived
Formatting tweaks, added window destructor
This commit is contained in:
@@ -118,7 +118,7 @@ namespace Worldbuilder
|
||||
|
||||
public void OnResize(Gtk.Widget widget, int width, int height)
|
||||
{
|
||||
print("SceneRenderer / Resizing...\n");
|
||||
// print("SceneRenderer / Resizing...\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+61
-61
@@ -10,74 +10,74 @@
|
||||
<property name="default-width">1280</property>
|
||||
<property name="default-height">720</property>
|
||||
|
||||
<property name="content">
|
||||
<object class="AdwOverlaySplitView" id="split_view">
|
||||
<property name="sidebar-width-fraction">0.25</property>
|
||||
<property name="sidebar-width-unit">px</property>
|
||||
<property name="max-sidebar-width">200</property>
|
||||
<property name="min-sidebar-width">200</property>
|
||||
<property name="show-sidebar">true</property>
|
||||
<property name="content">
|
||||
<object class="AdwOverlaySplitView" id="split_view">
|
||||
<property name="sidebar-width-fraction">0.25</property>
|
||||
<property name="sidebar-width-unit">px</property>
|
||||
<property name="max-sidebar-width">200</property>
|
||||
<property name="min-sidebar-width">200</property>
|
||||
<property name="show-sidebar">true</property>
|
||||
|
||||
<property name="sidebar">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="sidebar">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
|
||||
<property name="title-widget">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">WorldBuilder</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</property>
|
||||
<property name="title-widget">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">WorldBuilder</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
<property name="show-end-title-buttons">false</property>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="primary">True</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Main Menu</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<property name="show-end-title-buttons">false</property>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="primary">True</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Main Menu</property>
|
||||
<property name="menu-model">primary_menu</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
<property name="content">
|
||||
<object class="AdwToolbarView">
|
||||
<property name="top-bar-style">flat</property>
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="show-end-title-buttons">true</property>
|
||||
<property name="show-title">false</property>
|
||||
<property name="content">
|
||||
<object class="AdwToolbarView">
|
||||
<property name="top-bar-style">flat</property>
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="show-end-title-buttons">true</property>
|
||||
<property name="show-title">false</property>
|
||||
|
||||
<style>
|
||||
<class name="preview-headerbar"/>
|
||||
</style>
|
||||
<style>
|
||||
<class name="preview-headerbar"/>
|
||||
</style>
|
||||
|
||||
<child type="start">
|
||||
<object class="GtkToggleButton" id="sidebar_toggle_button">
|
||||
<property name="icon-name">sidebar-show-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Toggle Sidebar</property>
|
||||
<property name="active" bind-source="split_view" bind-property="show-sidebar" bind-flags="sync-create | bidirectional">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="start">
|
||||
<object class="GtkToggleButton" id="sidebar_toggle_button">
|
||||
<property name="icon-name">sidebar-show-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Toggle Sidebar</property>
|
||||
<property name="active" bind-source="split_view" bind-property="show-sidebar" bind-flags="sync-create | bidirectional">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkGLArea" id="draw_area">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkGLArea" id="draw_area">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
|
||||
<menu id="primary_menu">
|
||||
|
||||
+10
-6
@@ -18,22 +18,26 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Worldbuilder
|
||||
{
|
||||
[GtkTemplate (ui = "/com/brodybrooks/WorldBuilder/window.ui")]
|
||||
namespace Worldbuilder {
|
||||
[GtkTemplate(ui = "/com/brodybrooks/WorldBuilder/window.ui")]
|
||||
public class Window : Adw.ApplicationWindow {
|
||||
[GtkChild]
|
||||
private unowned Gtk.GLArea draw_area;
|
||||
|
||||
private SceneRenderer renderer;
|
||||
|
||||
public Window (Gtk.Application app) {
|
||||
Object (application: app);
|
||||
public Window(Gtk.Application app) {
|
||||
Object(application: app);
|
||||
renderer = new SceneRenderer();
|
||||
|
||||
draw_area.realize.connect(renderer.Setup);
|
||||
draw_area.render.connect(renderer.Render);
|
||||
draw_area.resize.connect(renderer.OnResize);
|
||||
}
|
||||
|
||||
~Window()
|
||||
{
|
||||
print("Closing!!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user