Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big update, new tools, better code #22

Merged
merged 27 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
04a2ed1
ported to use Gtk.Inscription instead of Gtk.Label hopefully with per…
Nokse22 Dec 19, 2023
d1ef495
used ui file, improved UI
Nokse22 Dec 20, 2023
6dcc922
added menus, improved stack switcher ui, started to add select tool
Nokse22 Dec 21, 2023
77039e2
removed unused code, added increase size popover
Nokse22 Dec 21, 2023
e7bfdb4
divided char list into pages
Nokse22 Dec 22, 2023
862b4b1
added custom palettes
Nokse22 Dec 23, 2023
5cfab8c
started adding classes for tools and canvas
Nokse22 Dec 29, 2023
1ce1519
updated rectangle tool, other fixes
Nokse22 Dec 29, 2023
2df949d
updated filled rectangle tool
Nokse22 Dec 30, 2023
02595e0
started updating all the tools, updated line and arrow, arrow doesnpt…
Nokse22 Dec 30, 2023
6c1a913
moved icons and ui file to another folder, updated tools, table missi…
Nokse22 Dec 31, 2023
6d9970a
fixed select border dragging logic
Nokse22 Dec 31, 2023
dc04473
almost finished select tool
Nokse22 Dec 31, 2023
55ee6c8
almost finished uniting line and arrow tools
Nokse22 Jan 1, 2024
491d270
updated eraser, added new palette from canvas, improved select, new p…
Nokse22 Jan 2, 2024
b98aa1e
fixed bugs with select tool
Nokse22 Jan 2, 2024
823767a
fixed bugs in select tool and canvas
Nokse22 Jan 3, 2024
ba60626
added unselect when clicking
Nokse22 Jan 3, 2024
4621082
porting to use drawing area for faster performance
Nokse22 Jan 5, 2024
2bec771
ui fixes and changes
Nokse22 Jan 6, 2024
fc24bf2
updated tree tool, fixed cartesian line bugs, improved ui, code clean…
Nokse22 Jan 6, 2024
f552956
fixed bugs with table
Nokse22 Jan 6, 2024
aa2d41d
used FileDialog instead of FileChooserNative
Nokse22 Jan 10, 2024
be6acf9
fixed color scheme when dark mode is toggled
Nokse22 Jan 10, 2024
f3977d8
fixed undo bug with text, improved preview
Nokse22 Jan 10, 2024
25735e5
improved ui, fixed issue with new palette window
Nokse22 Jan 10, 2024
1cbc9cf
fixed table tool
Nokse22 Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
548 changes: 548 additions & 0 deletions ascii-draw-window.cmb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<gresources>
<gresource prefix="/io/github/nokse22/asciidraw">
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks">ui/window.ui</file>
<file preprocess="xml-stripblanks">ui/new_palette.ui</file>
<file preprocess="xml-stripblanks">ui/canvas.ui</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/eraser-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/paintbrush-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/text-symbolic.svg</file>
Expand All @@ -13,5 +16,9 @@
<file preprocess="xml-stripblanks">icons/16x16/actions/increase-canvas-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/table-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/tree-list-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/format-text-italic-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/sidebar-show-right-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/line-style-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/16x16/actions/edit-undo-symbolic.svg</file>
</gresource>
</gresources>
File renamed without changes.
4 changes: 4 additions & 0 deletions data/icons/16x16/actions/edit-undo-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/icons/16x16/actions/format-text-italic-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions data/icons/16x16/actions/line-style-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions data/icons/16x16/actions/sidebar-show-right-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions data/io.github.nokse22.asciidraw.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
</key>
<key name="window-height" type="i">
<default>800</default>
</key>
<key name="palettes" type="s">
<default>'█░▒▓'</default>
</key>
</schema>
</schemalist>
9 changes: 9 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ desktop_file = i18n.merge_file(
install_dir: join_paths(get_option('datadir'), 'applications')
)

pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())

gnome.compile_resources('ascii-draw',
'ascii-draw.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
)

desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils, args: [desktop_file])
Expand Down
53 changes: 53 additions & 0 deletions data/ui/canvas.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<!-- interface-name canvas.ui -->
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<template class="Canvas" parent="AdwBin">
<child>
<object class="GtkScrolledWindow">
<child>
<object class="GtkOverlay">
<property name="child">
<object class="GtkGrid" id="draw_grid">
<property name="css-classes">ascii-textview
canvas-shadow</property>
<property name="halign">start</property>
<property name="valign">start</property>
</object>
</property>
<property name="halign">center</property>
<property name="margin-bottom">12</property>
<property name="margin-end">12</property>
<property name="margin-start">12</property>
<property name="margin-top">12</property>
<property name="valign">center</property>
<child type="overlay">
<object class="GtkGrid" id="preview_grid">
<property name="can-focus">False</property>
<property name="css-classes">ascii-preview</property>
<property name="halign">start</property>
<property name="valign">start</property>
</object>
</child>
<child type="overlay">
<object class="GtkDrawingArea" id="draw_drawing_area">
<property name="css-classes">ascii-textview
canvas-shadow</property>
</object>
</child>
<child type="overlay">
<object class="GtkDrawingArea" id="preview_drawing_area">
<property name="css-classes">ascii-preview</property>
</object>
</child>
<child type="overlay">
<object class="GtkDrawingArea" id="drawing_area"/>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
71 changes: 71 additions & 0 deletions data/ui/new_palette.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<!-- interface-name ascii-draw-new-palette.ui -->
<requires lib="gtk" version="4.12"/>
<requires lib="libadwaita" version="1.2"/>
<template class="NewPaletteWindow" parent="AdwWindow">
<property name="default-height">360</property>
<property name="default-width">360</property>
<property name="modal">True</property>
<property name="title" translatable="yes">New palette</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="css-classes">flat</property>
</object>
</child>
<child>
<object class="GtkBox">
<child>
<object class="GtkBox">
<property name="hexpand">True</property>
<property name="margin-bottom">12</property>
<property name="margin-end">12</property>
<property name="margin-start">12</property>
<property name="margin-top">12</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="vexpand">True</property>
<child>
<object class="AdwEntryRow" id="palette_name_entry">
<property name="css-classes">card</property>
<property name="title" translatable="yes">Palette name</property>
</object>
</child>
<child>
<object class="GtkTextView">
<property name="bottom-margin">12</property>
<property name="buffer">
<object class="GtkTextBuffer" id="palette_chars_buffer"/>
</property>
<property name="css-classes">card</property>
<property name="left-margin">12</property>
<property name="right-margin">12</property>
<property name="top-margin">12</property>
<property name="vexpand">True</property>
<property name="wrap-mode">word-char</property>
</object>
</child>
<child>
<object class="GtkButton" id="add_button">
<property name="css-classes">suggested-action
pill</property>
<property name="halign">center</property>
<property name="label" translatable="yes">Save</property>
<property name="valign">center</property>
<property name="vexpand">True</property>
<signal name="clicked" handler="on_add_clicked"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>

Loading