[qwaq] Set the window title to the file name

This commit is contained in:
Bill Currie 2020-03-25 01:39:56 +09:00
parent 0d8815f274
commit 1c3e503ad2
3 changed files with 11 additions and 1 deletions

View file

@ -52,6 +52,7 @@
file_proxy = [[ProxyView alloc] initWithView: current_file];
//FIXME id<View>?
[source_window insertSelected: (View *) file_proxy];
[source_window setTitle: [current_file filename]];
[source_window redraw];
}

View file

@ -5,6 +5,7 @@
@class Group;
@class Button;
@class TitleBar;
#include "qwaq-draw.h"
#include "qwaq-rect.h"
@ -25,8 +26,10 @@
Button *bottomLeftDrag;
Button *bottomRightDrag;
Button *bottomDrag;
TitleBar *titleBar;
}
+windowWithRect: (Rect) rect;
-setTitle:(string) title;
-setBackground: (int) ch;
-insert: (View *) view;
-insertDrawn: (View *) view;

View file

@ -28,7 +28,7 @@
objects = [[Group alloc] initWithContext: textContext owner: self];
[self insert: [[TitleBar alloc] initWithTitle:"drag me"]];
[self insert: titleBar = [[TitleBar alloc] initWithTitle:""]];
topDrag = [[Button alloc] initWithRect: {{2, 0},
{xlen - 4, 1}}];
@ -74,6 +74,12 @@
return self;
}
-setTitle:(string) title
{
[titleBar setTitle:title];
return self;
}
#ifndef max
# define max(a,b) ((a) > (b) ? (a) : (b))
#endif