Skip to content

Commit

Permalink
Basic UI with Glade
Browse files Browse the repository at this point in the history
Azzaare committed May 2, 2023
1 parent dc8b8ef commit 70c8adc
Showing 7 changed files with 386 additions and 3 deletions.
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
FTPClient = "01fcc997-4f28-56b8-8a06-30002c134abb"
GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
GtkReactive = "27996c0f-39cd-5cc1-a27a-05f136f946b6"

[compat]
Bibliography = "0.2"
4 changes: 2 additions & 2 deletions src/StaticWebPages.jl
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ using DataStructures
using FTPClient
using GitHub

using Gtk, GtkReactive
using Gtk

import Base.show

@@ -31,6 +31,6 @@ include("items.jl")
include("skeleton.jl")
include("page.jl")
include("io.jl")
include("gui.jl")
include("ui.jl")

end # module StaticWebPages
174 changes: 174 additions & 0 deletions src/builder/StaticWebPages.glade
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.38.2
StaticWebPages.jl - A black-box generator for static websites oriented toward academics and personal web-pages
Copyright (C)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-->
<interface>
<requires lib="gtk+" version="3.24"/>
<!-- interface-license-type gplv2 -->
<!-- interface-name StaticWebPages.jl -->
<!-- interface-description A black-box generator for static websites oriented toward academics and personal web-pages -->
<object class="GtkWindow" id="window">
<property name="width-request">800</property>
<property name="height-request">600</property>
<property name="can-focus">False</property>
<property name="hide-titlebar-when-maximized">True</property>
<property name="icon">logo.png</property>
<child>
<object class="GtkBox" id="bigbox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="title" translatable="yes">StaticWebPages.jl</property>
<property name="subtitle" translatable="yes">(empty)</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkButtonBox" id="actions">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="layout-style">expand</property>
<child>
<object class="GtkMenuButton" id="build">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="direction">none</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="ftp">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="direction">none</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="push">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="direction">none</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="pack-type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="open_project">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="title" translatable="yes"/>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="new_project">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="focus-on-click">False</property>
<property name="receives-default">True</property>
<property name="direction">none</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkPaned" id="shokupan">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkTreeView" id="tree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="level-indentation">4</property>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
<child>
<object class="GtkFlowBox" id="flow">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="resize">True</property>
<property name="shrink">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
Binary file added src/builder/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed src/gui.jl
Empty file.
38 changes: 38 additions & 0 deletions src/ui.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module UI

using Gtk
# using GtkReactive

export ui

set_subtitle!(widget, str) = set_gtk_property!(widget, :subtitle, str)

function ui()
uifile = joinpath(@__DIR__, "builder", "StaticWebPages.glade")
builder = GtkBuilder(filename=uifile)

# Associates widgets from GtkBuilder
win = builder["window"]
header = builder["header"]
actions = builder["actions"]
build = builder["build"]
ftp = builder["ftp"]
push = builder["push"]
open_ = builder["open_project"]
new_ = builder["new_project"]
flow = builder["flow"]
tree = builder["tree"]

set_subtitle!(header, "$(pwd())")

ls = GtkTreeStore(String)
info = push!(ls, ("Information",))
index = push!(ls, ("Index",))
test = push!(ls, ("Test",), index)

showall(win)

return win
end

end
Loading

0 comments on commit 70c8adc

Please sign in to comment.