EmacsFontSelectionDialog (bool monospace_only,
int initial_family_idx,
- int initial_style_idx)
+ int initial_style_idx,
+ int initial_size)
: BWindow (BRect (0, 0, 500, 500),
"Select font from list",
B_TITLED_WINDOW_LOOK,
uint32 flags, c;
BMessage *selection;
BTextView *size_text;
+ char format_buffer[4];
AddChild (&basic_view);
for (c = 58; c <= 127; ++c)
size_text->DisallowChar (c);
+
+ if (initial_size > 0 && initial_size < 1000)
+ {
+ sprintf (format_buffer, "%d", initial_size);
+ size_entry.SetText (format_buffer);
+ }
}
void
haiku_font_family_or_style *family,
haiku_font_family_or_style *style,
int *size, bool allow_monospace_only,
- int initial_family, int initial_style)
+ int initial_family, int initial_style,
+ int initial_size)
{
EmacsFontSelectionDialog *dialog;
struct font_selection_dialog_message msg;
font_style style_buffer;
dialog = new EmacsFontSelectionDialog (allow_monospace_only,
- initial_family, initial_style);
+ initial_family, initial_style,
+ initial_size);
dialog->CenterOnScreen ();
if (dialog->InitCheck () < B_OK)
extern bool be_select_font (void (*) (void), bool (*) (void),
haiku_font_family_or_style *,
haiku_font_family_or_style *,
- int *, bool, int, int);
+ int *, bool, int, int, int);
extern int be_find_font_indices (struct haiku_font_pattern *, int *, int *);
#ifdef __cplusplus
struct font *font;
Lisp_Object font_object;
haiku_font_family_or_style family, style;
- int rc, size, initial_family, initial_style;
+ int rc, size, initial_family, initial_style, initial_size;
struct haiku_font_pattern pattern;
Lisp_Object lfamily, lweight, lslant, lwidth, ladstyle, lsize;
initial_style = -1;
initial_family = -1;
+ initial_size = -1;
font = FRAME_FONT (f);
be_find_font_indices (&pattern, &initial_family,
&initial_style);
haikufont_done_with_query_pattern (&pattern);
+
+ initial_size = font->pixel_size;
}
popup_activated_p++;
haikufont_should_quit_popup,
&family, &style, &size,
!NILP (exclude_proportional),
- initial_family, initial_style);
+ initial_family, initial_style,
+ initial_size);
request_sigio ();
popup_activated_p--;