Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #82 from ppvan/dev
Browse files Browse the repository at this point in the history
Using precomit and update some code formating
  • Loading branch information
ppvan authored Jun 14, 2024
2 parents 1709e05 + c583e44 commit d911f3c
Show file tree
Hide file tree
Showing 70 changed files with 6,042 additions and 4,879 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fail_fast: false
repos:
- repo: https://github.com/ppvan/pre-commit-hooks
rev: 2ce5a35bba2a6031563657dd4421250d644dd914
hooks:
- id: uncrustify
args: [--no-diff, -l, VALA, -c, uncrustify.cfg, --replace, --no-backup]
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

debug:
rm -rf build/resources/gtk
meson configure -Dbuildtype=debug build
ninja -C build/ && G_MESSAGES_DEBUG=Psequel ./build/src/psequel

release:
meson configure -Dbuildtype=release build
ninja -C build/ && G_MESSAGES_DEBUG=Psequel ./build/src/psequel

clean:
Expand All @@ -13,7 +18,7 @@ test:
flatpak:
flatpak-builder --install-deps-from=flathub build-aux/ me.ppvan.psequel.json --force-clean
flatpak build-export export build-aux
flatpak build-bundle export me.ppvan.psequel.flatpak me.ppvan.psequel --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
flatpak build-bundle export ./build-aux/me.ppvan.psequel.flatpak me.ppvan.psequel --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo

run:
G_MESSAGES_DEBUG=Psequel ./build/src/psequel
Binary file removed me.ppvan.psequel.flatpak
Binary file not shown.
16 changes: 8 additions & 8 deletions resources/gtk/datacell.blp
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ menu menu {
}
}

// section {
// item {
// label: _("_Edit Row");
// action: "schema.edit";
// }
// }
section {
item {
label: _("_Edit Row");
action: "schema.edit";
}
}
}

template $PsequelDataCell: Adw.Bin {
Box {
Label label {
Inscription label {
styles [
"table-cell"
]

text-overflow: ellipsize_end;
halign: start;
}

Expand Down
69 changes: 69 additions & 0 deletions resources/gtk/edit-row.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
using Gtk 4.0;
using Adw 1;

template $PsequelEditRowDialog: Adw.Dialog {
follows-content-size: true;
title: _("Edit");
presentation-mode: floating;

styles [
"backup-dialog"
]

child: Adw.ToolbarView {
[top]
Adw.HeaderBar {}

width-request: 640;

content: ScrolledWindow {
vexpand: true;
hexpand: true;
max-content-height: 960;
min-content-height: 400;
valign: center;
hscrollbar-policy: never;

Grid grid {
margin-bottom: 16;
margin-top: 16;
margin-start: 16;
margin-end: 16;
row-spacing: 10;
column-spacing: 8;
column-homogeneous: true;
}
};

[bottom]
Box {
orientation: vertical;
Separator {

}
Box {
halign: end;
margin-bottom: 16;
margin-top: 16;
margin-start: 16;
margin-end: 16;
spacing: 16;

Button {
label: "Cancel";
clicked => $cancel_update();
}

Button {
label: "Update";
clicked => $update_row();
sensitive: bind template.has_changed;

styles [
"suggested-action"
]
}
}
}
};
}
1 change: 1 addition & 0 deletions resources/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ mark_ups = [
'gtk/window.blp',
'gtk/backup-dialog.blp',
'gtk/restore-dialog.blp',
'gtk/edit-row.blp',
'gtk/where-entry.blp'
]

Expand Down
4 changes: 2 additions & 2 deletions script/formater.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/bash
# git diff --name-only --diff-filter=ACM

for i in $(git diff --name-only --diff-filter=ACM|grep .vala$);
for i in $(git diff --name-only --staged --diff-filter=ACM|grep .vala$);
do
uncrustify -l VALA -c uncrustify.cfg --replace --no-backup $i;
uncrustify -l VALA -c uncrustify.cfg --replace --no-backup $i;
done
Loading

0 comments on commit d911f3c

Please sign in to comment.