Connected the font size menu. "Fit" doesn't work yet, though.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6746 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1053,6 +1053,8 @@ DataView::SetFontSize(float point)
|
|||||||
font.SetSize(point);
|
font.SetSize(point);
|
||||||
|
|
||||||
SetFont(&font);
|
SetFont(&font);
|
||||||
|
UpdateScroller();
|
||||||
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
static const uint32 kMsgSliderUpdate = 'slup';
|
static const uint32 kMsgSliderUpdate = 'slup';
|
||||||
static const uint32 kMsgPositionUpdate = 'poup';
|
static const uint32 kMsgPositionUpdate = 'poup';
|
||||||
static const uint32 kMsgLastPosition = 'lpos';
|
static const uint32 kMsgLastPosition = 'lpos';
|
||||||
|
static const uint32 kMsgFontSize = 'fnts';
|
||||||
|
|
||||||
|
|
||||||
class IconView : public BView {
|
class IconView : public BView {
|
||||||
@@ -1115,15 +1116,17 @@ ProbeView::AttachedToWindow()
|
|||||||
for (uint32 i = 0; i < sizeof(fontSizes) / sizeof(fontSizes[0]); i++) {
|
for (uint32 i = 0; i < sizeof(fontSizes) / sizeof(fontSizes[0]); i++) {
|
||||||
char buffer[16];
|
char buffer[16];
|
||||||
snprintf(buffer, sizeof(buffer), "%ld", fontSizes[i]);
|
snprintf(buffer, sizeof(buffer), "%ld", fontSizes[i]);
|
||||||
subMenu->AddItem(item = new BMenuItem(buffer, NULL));
|
subMenu->AddItem(item = new BMenuItem(buffer, message = new BMessage(kMsgFontSize)));
|
||||||
|
message->AddFloat("font_size", fontSizes[i]);
|
||||||
if (fontSizes[i] == fontSize)
|
if (fontSizes[i] == fontSize)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
subMenu->AddSeparatorItem();
|
subMenu->AddSeparatorItem();
|
||||||
subMenu->AddItem(item = new BMenuItem("Fit", NULL));
|
subMenu->AddItem(item = new BMenuItem("Fit", new BMessage(kMsgFontSize)));
|
||||||
if (fontSize == 0)
|
if (fontSize == 0)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
|
|
||||||
|
subMenu->SetTargetForItems(this);
|
||||||
subMenu->SetRadioMode(true);
|
subMenu->SetRadioMode(true);
|
||||||
menu->AddItem(new BMenuItem(subMenu));
|
menu->AddItem(new BMenuItem(subMenu));
|
||||||
|
|
||||||
@@ -1259,6 +1262,21 @@ ProbeView::MessageReceived(BMessage *message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case kMsgFontSize:
|
||||||
|
{
|
||||||
|
float size = 0.0f;
|
||||||
|
message->FindFloat("font_size", &size);
|
||||||
|
|
||||||
|
fDataView->SetFontSize(size);
|
||||||
|
UpdateSizeLimits();
|
||||||
|
|
||||||
|
// update the applications settings
|
||||||
|
BMessage update(*message);
|
||||||
|
update.what = kMsgSettingsChanged;
|
||||||
|
be_app_messenger.SendMessage(&update);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case B_NODE_MONITOR:
|
case B_NODE_MONITOR:
|
||||||
{
|
{
|
||||||
switch (message->FindInt32("opcode")) {
|
switch (message->FindInt32("opcode")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user