* use B_PNG_FORMAT, thanks Stephan
* truncate the path label, since a long path would automatically
resize the window to something unusable in that case...
Note: somehow the PopUpMenu does ignore a set max column size
expanding from small to large leaves some drawing artefacts
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27647 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -59,9 +59,6 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const int32 kPNGImageFileType = 1347307296;
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - DirectoryRefFilter
|
// #pragma mark - DirectoryRefFilter
|
||||||
|
|
||||||
|
|
||||||
@@ -174,11 +171,14 @@ ScreenshotWindow::MessageReceived(BMessage* message)
|
|||||||
case B_REFS_RECEIVED: {
|
case B_REFS_RECEIVED: {
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if (message->FindRef("refs", &ref) == B_OK) {
|
if (message->FindRef("refs", &ref) == B_OK) {
|
||||||
BPath path(&ref);
|
BString path(BPath(&ref).Path());
|
||||||
BMessage* message = new BMessage(kLocationChanged);
|
|
||||||
message->AddString("path", path.Path());
|
|
||||||
|
|
||||||
fLastSelectedPath = new BMenuItem(path.Path(), message);
|
BMessage* message = new BMessage(kLocationChanged);
|
||||||
|
message->AddString("path", path.String());
|
||||||
|
|
||||||
|
fOutputPathMenu->TruncateString(&path, B_TRUNCATE_MIDDLE,
|
||||||
|
fOutputPathMenu->StringWidth("SomethingLongHere"));
|
||||||
|
fLastSelectedPath = new BMenuItem(path.String(), message);
|
||||||
fLastSelectedPath->SetMarked(true);
|
fLastSelectedPath->SetMarked(true);
|
||||||
|
|
||||||
fOutputPathMenu->AddItem(fLastSelectedPath,
|
fOutputPathMenu->AddItem(fLastSelectedPath,
|
||||||
@@ -391,7 +391,7 @@ ScreenshotWindow::_SetupTranslatorMenu(BMenu* translatorMenu)
|
|||||||
if (item && item->Message()) {
|
if (item && item->Message()) {
|
||||||
item->Message()->FindInt32("be:type", &fImageFileType);
|
item->Message()->FindInt32("be:type", &fImageFileType);
|
||||||
item->Message()->FindInt32("be:translator", &fTranslator);
|
item->Message()->FindInt32("be:translator", &fTranslator);
|
||||||
if (fImageFileType == kPNGImageFileType) {
|
if (fImageFileType == B_PNG_FORMAT) {
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -581,7 +581,7 @@ ScreenshotWindow::_SaveScreenshot()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
BBitmapStream bitmapStream(fScreenshot);
|
BBitmapStream bitmapStream(fScreenshot);
|
||||||
BTranslatorRoster *roster = BTranslatorRoster::Default();
|
BTranslatorRoster* roster = BTranslatorRoster::Default();
|
||||||
roster->Translate(&bitmapStream, NULL, NULL, &file, fImageFileType,
|
roster->Translate(&bitmapStream, NULL, NULL, &file, fImageFileType,
|
||||||
B_TRANSLATOR_BITMAP);
|
B_TRANSLATOR_BITMAP);
|
||||||
fScreenshot = NULL;
|
fScreenshot = NULL;
|
||||||
@@ -591,7 +591,7 @@ ScreenshotWindow::_SaveScreenshot()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int32 numFormats;
|
int32 numFormats;
|
||||||
const translation_format *formats = NULL;
|
const translation_format* formats = NULL;
|
||||||
if (roster->GetOutputFormats(fTranslator, &formats, &numFormats) != B_OK)
|
if (roster->GetOutputFormats(fTranslator, &formats, &numFormats) != B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user