Skip to content

Commit e3ad444

Browse files
committed
simpler system for positioning new columns
1 parent 1568ecd commit e3ad444

File tree

3 files changed

+10
-37
lines changed

3 files changed

+10
-37
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ started 8.3.1 on 19/5/16
33
- configure changes to help win64
44
- fix middle-drag in ws and image view
55
- be more careful about the name of the image file we remove on close
6+
- simpler system for positioning new columns
67

78
started 8.3.0 on 28/3/16
89
- move path search stuff into _convert from _magick

TODO

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
- ^N in ws should always put the new column just to the left of the leftmost
2+
complete column in the viewport
3+
4+
or just to the right of the current column?
5+
6+
current behaviour is to insert alphabetically and scroll, which is awful
7+
18
- sharpen should use new interface?
29

310
- can we call affine from nip2 vips_call? do we need a double array?

src/column.c

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -336,39 +336,10 @@ column_get_type( void )
336336
return( column_type );
337337
}
338338

339-
static gint
340-
iobject_name_compare( iObject *a, iObject *b )
341-
{
342-
return( strcasecmp( a->name, b->name ) );
343-
}
344-
345-
/* Search for the column before this name in alphabetical order.
346-
*/
347-
static Column *
348-
column_find_previous( Column *col )
349-
{
350-
Workspace *ws = col->ws;
351-
352-
GSList *columns;
353-
Column *previous_col;
354-
int i;
355-
356-
columns = icontainer_get_children( ICONTAINER( ws ) );
357-
columns = g_slist_sort( columns, (GCompareFunc) iobject_name_compare );
358-
i = g_slist_index( columns, col );
359-
previous_col = NULL;
360-
if( i > 0 )
361-
previous_col = COLUMN( g_slist_nth_data( columns, i - 1 ) );
362-
g_slist_free( columns );
363-
364-
return( previous_col );
365-
}
366-
367339
Column *
368340
column_new( Workspace *ws, const char *name )
369341
{
370342
Column *col;
371-
Column *previous_col;
372343

373344
if( workspace_column_find( ws, name ) ) {
374345
error_top( _( "Name clash." ) );
@@ -383,14 +354,8 @@ column_new( Workspace *ws, const char *name )
383354

384355
subcolumn_new( NULL, col );
385356

386-
if( (previous_col = column_find_previous( col )) ) {
387-
col->x = previous_col->x + 50;
388-
col->y = previous_col->y;
389-
}
390-
else {
391-
col->x = ws->vp.left;
392-
col->y = ws->vp.top;
393-
}
357+
col->x = ws->vp.left + 50;
358+
col->y = ws->vp.top;
394359

395360
column_set_last_new( col );
396361

0 commit comments

Comments
 (0)