SGITranslator: Resize menu field to preferred width
... when the window is first activated. Unfortunately the preferred width has not been set until after the window is shown so we can't do the work in AllAttached().
This commit is contained in:
@@ -157,6 +157,8 @@ void
|
|||||||
SGIView::AllAttached()
|
SGIView::AllAttached()
|
||||||
{
|
{
|
||||||
fCompressionMF->Menu()->SetTargetForItems(this);
|
fCompressionMF->Menu()->SetTargetForItems(this);
|
||||||
|
fCompressionMF->SetDivider(
|
||||||
|
fCompressionMF->StringWidth(fCompressionMF->Label()) + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -177,3 +179,15 @@ SGIView::MessageReceived(BMessage* message)
|
|||||||
BView::MessageReceived(message);
|
BView::MessageReceived(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
SGIView::WindowActivated(bool active)
|
||||||
|
{
|
||||||
|
static bool firstRun = true;
|
||||||
|
|
||||||
|
if (firstRun) {
|
||||||
|
firstRun = false;
|
||||||
|
fCompressionMF->ResizeToPreferred();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
|
|
||||||
virtual void AllAttached();
|
virtual void AllAttached();
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
virtual void WindowActivated(bool active);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MSG_COMPRESSION_CHANGED = 'cmch',
|
MSG_COMPRESSION_CHANGED = 'cmch',
|
||||||
|
|||||||
Reference in New Issue
Block a user