Skip to content

Commit b3ff0d6

Browse files
committed
small
1 parent f8395ae commit b3ff0d6

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

TODO

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
- could right-click on a region label pop up the rowview menu?
44

5+
difficult with the structure we have now
6+
57
- put region snap back?
68

79
- maxpos, then create mark from coordinate should be two clicks

src/imageui.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ imageui_key_released(GtkEventControllerKey *self,
987987

988988
// (x, y) in gtk cods
989989
static Regionview *
990-
imageui_find_regionview(Imageui *imageui, int x, int y)
990+
imageui_pick_regionview(Imageui *imageui, int x, int y)
991991
{
992992
for (GSList *p = imageui->regionviews; p; p = p->next) {
993993
Regionview *regionview = REGIONVIEW(p->data);
@@ -1015,7 +1015,7 @@ imageui_drag_begin(GtkEventControllerMotion *self,
10151015

10161016
switch (imageui->state) {
10171017
case IMAGEUI_WAIT:
1018-
regionview = imageui_find_regionview(imageui, start_x, start_y);
1018+
regionview = imageui_pick_regionview(imageui, start_x, start_y);
10191019

10201020
if (regionview) {
10211021
imageui->state = IMAGEUI_SELECT;
@@ -1221,7 +1221,7 @@ imageui_set_cursor(Imageui *imageui)
12211221

12221222
Regionview *regionview;
12231223

1224-
if ((regionview = imageui_find_regionview(imageui, x, y)))
1224+
if ((regionview = imageui_pick_regionview(imageui, x, y)))
12251225
resize = regionview_hit(regionview, x, y);
12261226
}
12271227

src/imagewindow.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,14 +1351,13 @@ static void
13511351
imagewindow_pressed(GtkGestureClick *gesture,
13521352
guint n_press, double x, double y, Imagewindow *win)
13531353
{
1354-
gtk_popover_set_pointing_to(GTK_POPOVER(win->right_click_menu),
1354+
Imageui *imageui = win->imageui;
1355+
GtkWidget *menu = win->right_click_menu;
1356+
1357+
gtk_popover_set_pointing_to(GTK_POPOVER(menu),
13551358
&(const GdkRectangle){ x, y, 1, 1 });
13561359

1357-
/* This produces a lot of warnings :( not sure why. I tried calling
1358-
* gtk_popover_present() in realize to force allocation, but it didn't
1359-
* help.
1360-
*/
1361-
gtk_popover_popup(GTK_POPOVER(win->right_click_menu));
1360+
gtk_popover_popup(GTK_POPOVER(menu));
13621361
}
13631362

13641363
static void

src/iregion.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ iregion_save(Model *model, xmlNode *xnode)
201201
*/
202202
gpointer parent_class = PARENT_CLASS_DYNAMIC(model);
203203

204-
iRegionInstance *instance =
205-
classmodel_get_instance(CLASSMODEL(model));
204+
iRegionInstance *instance = classmodel_get_instance(CLASSMODEL(model));
206205

207206
xmlNode *xthis;
208207

src/iregiongroup.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ iregiongroup_update_model(Heapmodel *heapmodel)
5252
if (heapmodel->row->sym)
5353
model_display(MODEL(heapmodel),
5454
!is_super(heapmodel->row->sym) &&
55-
!is_this(heapmodel->row->sym));
55+
!is_this(heapmodel->row->sym));
5656

5757
return NULL;
5858
}
@@ -94,8 +94,7 @@ iregiongroup_new(Classmodel *classmodel)
9494

9595
iregiongroup = IREGIONGROUP(g_object_new(IREGIONGROUP_TYPE, NULL));
9696

97-
icontainer_child_add(ICONTAINER(classmodel),
98-
ICONTAINER(iregiongroup), -1);
97+
icontainer_child_add(ICONTAINER(classmodel), ICONTAINER(iregiongroup), -1);
9998

10099
#ifdef DEBUG
101100
printf("iregiongroup_new: ");

src/util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,11 @@ slist_equal(GSList *l1, GSList *l2)
493493
void *
494494
slist_map(GSList *list, SListMapFn fn, gpointer a)
495495
{
496-
GSList *i;
497496
void *result;
498497

499498
g_autoptr(GSList) copy = g_slist_copy(list);
500499
result = NULL;
501-
for (i = copy; i && !(result = fn(i->data, a)); i = i->next)
500+
for (GSList *p = copy; p && !(result = fn(p->data, a)); p = p->next)
502501
;
503502

504503
return result;

0 commit comments

Comments
 (0)