Added a Fullscreen shortcut (ALT-ENTER).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17554 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -91,6 +91,7 @@ const uint32 EIGHTYTWENTYFIVE = 'etfv';
|
|||||||
const uint32 EIGHTYFORTY = 'efor';
|
const uint32 EIGHTYFORTY = 'efor';
|
||||||
const uint32 ONETHREETWOTWENTYFOUR = 'hunf';
|
const uint32 ONETHREETWOTWENTYFOUR = 'hunf';
|
||||||
const uint32 ONETHREETWOTWENTYFIVE = 'hunv';
|
const uint32 ONETHREETWOTWENTYFIVE = 'hunv';
|
||||||
|
const uint32 FULLSCREEN = 'fscr';
|
||||||
|
|
||||||
const uint32 MSG_FONT_CHANGED = 'fntc';
|
const uint32 MSG_FONT_CHANGED = 'fntc';
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public:
|
|||||||
void SetMouseCursor (void);
|
void SetMouseCursor (void);
|
||||||
// void SetIMAware (bool);
|
// void SetIMAware (bool);
|
||||||
void SetScrollBar (BScrollBar *scrbar);
|
void SetScrollBar (BScrollBar *scrbar);
|
||||||
|
BScrollBar *ScrollBar () const { return fScrollBar; };
|
||||||
|
|
||||||
//
|
//
|
||||||
// Output Charactor.
|
// Output Charactor.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
#include <PrintJob.h>
|
#include <PrintJob.h>
|
||||||
#include <PropertyInfo.h>
|
#include <PropertyInfo.h>
|
||||||
|
#include <Screen.h>
|
||||||
#include <ScrollBar.h>
|
#include <ScrollBar.h>
|
||||||
#include <TextControl.h>
|
#include <TextControl.h>
|
||||||
#include <WindowScreen.h>
|
#include <WindowScreen.h>
|
||||||
@@ -197,7 +198,7 @@ TermWindow::SetupMenu(void)
|
|||||||
fMenubar = new BMenuBar(Bounds(), "mbar");
|
fMenubar = new BMenuBar(Bounds(), "mbar");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make Fiile Menu.
|
* Make File Menu.
|
||||||
*/
|
*/
|
||||||
fFilemenu = new BMenu("Terminal");
|
fFilemenu = new BMenu("Terminal");
|
||||||
fFilemenu->AddItem(new BMenuItem("Switch Terminals", new BMessage(MENU_SWITCH_TERM),'G'));
|
fFilemenu->AddItem(new BMenuItem("Switch Terminals", new BMessage(MENU_SWITCH_TERM),'G'));
|
||||||
@@ -240,6 +241,7 @@ TermWindow::SetupMenu(void)
|
|||||||
fWindowSizeMenu->AddItem(new BMenuItem("80x40", new BMessage(EIGHTYFORTY)));
|
fWindowSizeMenu->AddItem(new BMenuItem("80x40", new BMessage(EIGHTYFORTY)));
|
||||||
fWindowSizeMenu->AddItem(new BMenuItem("132x24", new BMessage(ONETHREETWOTWENTYFOUR)));
|
fWindowSizeMenu->AddItem(new BMenuItem("132x24", new BMessage(ONETHREETWOTWENTYFOUR)));
|
||||||
fWindowSizeMenu->AddItem(new BMenuItem("132x25", new BMessage(ONETHREETWOTWENTYFIVE)));
|
fWindowSizeMenu->AddItem(new BMenuItem("132x25", new BMessage(ONETHREETWOTWENTYFIVE)));
|
||||||
|
fWindowSizeMenu->AddItem(new BMenuItem("Fullscreen", new BMessage(FULLSCREEN), '\n'));
|
||||||
|
|
||||||
// Considering we have this in the preferences window, this menu is not
|
// Considering we have this in the preferences window, this menu is not
|
||||||
// needed and should not be shown if we are to not confuse the user
|
// needed and should not be shown if we are to not confuse the user
|
||||||
@@ -437,6 +439,33 @@ TermWindow::MessageReceived(BMessage *message)
|
|||||||
this->PostMessage (MSG_COLS_CHANGED);
|
this->PostMessage (MSG_COLS_CHANGED);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FULLSCREEN:
|
||||||
|
if (!fSavedFrame.IsValid()) { // go fullscreen
|
||||||
|
float mbHeight = fMenubar->Bounds().Height() + 1;
|
||||||
|
fSavedFrame = Frame();
|
||||||
|
BScreen screen(this);
|
||||||
|
fTermView->ScrollBar()->Hide();
|
||||||
|
fMenubar->Hide();
|
||||||
|
fBaseView->MoveTo(0,0);
|
||||||
|
fBaseView->ResizeBy(B_V_SCROLL_BAR_WIDTH, mbHeight);
|
||||||
|
fSavedLook = Look();
|
||||||
|
// done before ResizeTo to work around a Dano bug (not erasing the decor)
|
||||||
|
SetLook(B_NO_BORDER_WINDOW_LOOK);
|
||||||
|
ResizeTo(screen.Frame().Width()+1, screen.Frame().Height()+1);
|
||||||
|
MoveTo(screen.Frame().left, screen.Frame().top);
|
||||||
|
} else { // exit fullscreen
|
||||||
|
float mbHeight = fMenubar->Bounds().Height() + 1;
|
||||||
|
fMenubar->Show();
|
||||||
|
fTermView->ScrollBar()->Show();
|
||||||
|
ResizeTo(fSavedFrame.Width()+1, fSavedFrame.Height()+1);
|
||||||
|
MoveTo(fSavedFrame.left, fSavedFrame.top);
|
||||||
|
fBaseView->ResizeBy(-B_V_SCROLL_BAR_WIDTH, -mbHeight);
|
||||||
|
fBaseView->MoveTo(0,mbHeight);
|
||||||
|
SetLook(fSavedLook);
|
||||||
|
fSavedFrame = BRect(0,0,-1,-1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case MSG_FONT_CHANGED:
|
case MSG_FONT_CHANGED:
|
||||||
gTermPref->setString (PREF_HALF_FONT_FAMILY, fNewFontMenu->FindMarked()->Label());
|
gTermPref->setString (PREF_HALF_FONT_FAMILY, fNewFontMenu->FindMarked()->Label());
|
||||||
this->PostMessage (MSG_HALF_FONT_CHANGED);
|
this->PostMessage (MSG_HALF_FONT_CHANGED);
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ private:
|
|||||||
FindDlg *fFindPanel;
|
FindDlg *fFindPanel;
|
||||||
BMessageRunner *fWindowUpdate;
|
BMessageRunner *fWindowUpdate;
|
||||||
BMenuItem *item;
|
BMenuItem *item;
|
||||||
|
BRect fSavedFrame;
|
||||||
|
window_look fSavedLook;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TERMWIN_H
|
#endif // TERMWIN_H
|
||||||
|
|||||||
Reference in New Issue
Block a user