Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
crudelios committed May 8, 2024
1 parent 5b7491c commit 16eee04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .ci_scripts/run_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ case "$BUILD_TARGET" in
fi
;;
"flatpak")
flatpak-builder repo com.github.bvschaik.julius.json --install-deps-from=flathub --keep-build-dirs
cp .flatpak-builder/build/julius/res/version.txt res/version.txt
flatpak-builder repo com.github.keriew.augustus.json --install-deps-from=flathub --keep-build-dirs
cp .flatpak-builder/build/augustus/res/version.txt res/version.txt
;;
"appimage")
cp -r res/maps ./build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"id" : "com.github.bvschaik.julius",
"id" : "com.github.keriew.augustus",
"runtime" : "org.freedesktop.Platform",
"runtime-version" : "23.08",
"sdk" : "org.freedesktop.Sdk",
"command" : "julius",
"command" : "augustus",
"finish-args" : [
"--filesystem=home",
"--share=ipc",
"--device=dri",
"--socket=wayland",
Expand All @@ -14,7 +13,7 @@
],
"modules" : [
{
"name" : "julius",
"name" : "augustus",
"buildsystem" : "cmake-ninja",
"sources" : [
{
Expand Down
41 changes: 0 additions & 41 deletions src/graphics/scrollbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ enum {
TOUCH_DRAG_IN_PROGRESS = 2
};

enum {
TOUCH_DRAG_NONE = 0,
TOUCH_DRAG_PENDING = 1,
TOUCH_DRAG_IN_PROGRESS = 2
};

#define SCROLL_BUTTON_HEIGHT 26
#define SCROLL_BUTTON_WIDTH 39
#define SCROLL_DOT_SIZE 25
Expand Down Expand Up @@ -135,41 +129,6 @@ static int handle_touch(scrollbar_type *scrollbar, const touch *t, int in_dialog
return active;
}

static int touch_inside_scrollable_area(const scrollbar_type *scrollbar, const touch *t)
{
return scrollbar->max_scroll_position > 0 &&
t->start_point.x >= scrollbar->x - scrollbar->scrollable_width && t->start_point.x <= scrollbar->x - 2 &&
t->start_point.y >= scrollbar->y && t->start_point.y < scrollbar->y + scrollbar->height;
}

static int handle_touch(scrollbar_type *scrollbar, const touch *t)
{
int old_position = scrollbar->scroll_position;
int active = scrollbar->touch_drag_state == TOUCH_DRAG_IN_PROGRESS;

if (t->has_started && touch_inside_scrollable_area(scrollbar, t)) {
scrollbar->touch_drag_state = TOUCH_DRAG_PENDING;
scrollbar->position_on_touch = scrollbar->scroll_position;
}
if (t->has_moved && scrollbar->touch_drag_state != TOUCH_DRAG_NONE) {
scrollbar->touch_drag_state = TOUCH_DRAG_IN_PROGRESS;
int element_height = (scrollbar->height - 8 * scrollbar->has_y_margin) / scrollbar->elements_in_view;
int current_y = t->current_point.y - ((t->current_point.y - (scrollbar->y + 8 * scrollbar->has_y_margin)) % element_height);
int start_y = t->start_point.y - ((t->start_point.y - (scrollbar->y + 8 * scrollbar->has_y_margin)) % element_height);
int touch_scrolled = (current_y - start_y) / element_height;
scrollbar->scroll_position = calc_bound(scrollbar->position_on_touch - touch_scrolled, 0, scrollbar->max_scroll_position);
active = 1;
}
if (t->has_ended) {
scrollbar->touch_drag_state = TOUCH_DRAG_NONE;
// decay scrollbar movement
}
if (scrollbar->on_scroll_callback && old_position != scrollbar->scroll_position) {
scrollbar->on_scroll_callback();
}
return active;
}

static int handle_scrollbar_dot(scrollbar_type *scrollbar, const mouse *m)
{
if (scrollbar->max_scroll_position <= 0 || !m->left.is_down) {
Expand Down

0 comments on commit 16eee04

Please sign in to comment.