Skip to content

Commit

Permalink
Terminal: Add a tooltip when in fullscreen mode
Browse files Browse the repository at this point in the history
* When in full screen mode, add a tooltip with the window title,
and a keyboard shortcut hint so one knows how to get out of it.
Should help with #7356
* 80 column cleanup
  • Loading branch information
mmuman committed Nov 5, 2012
1 parent 8ef01bd commit ca0d271
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/apps/terminal/TermWindow.cpp
Expand Up @@ -77,6 +77,9 @@ using namespace BPrivate ; // BCharacterSet stuff
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "Terminal TermWindow"

// actually an arrow
#define UTF8_ENTER "\xe2\x86\xb5"


// #pragma mark - TermViewContainerView

Expand Down Expand Up @@ -795,14 +798,17 @@ TermWindow::MessageReceived(BMessage *message)
float mbHeight = fMenuBar->Bounds().Height() + 1;
fSavedFrame = Frame();
BScreen screen(this);
for (int32 i = fTabView->CountTabs() - 1; i >=0 ; i--)
_TermViewAt(i)->ScrollBar()->ResizeBy(0, (B_H_SCROLL_BAR_HEIGHT - 1));

for (int32 i = fTabView->CountTabs() - 1; i >= 0 ; i--)
_TermViewAt(i)->ScrollBar()->ResizeBy(0,
(B_H_SCROLL_BAR_HEIGHT - 1));

fMenuBar->Hide();
fTabView->ResizeBy(0, mbHeight);
fTabView->MoveBy(0, -mbHeight);
fSavedLook = Look();
// done before ResizeTo to work around a Dano bug (not erasing the decor)
// 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);
Expand All @@ -812,8 +818,11 @@ TermWindow::MessageReceived(BMessage *message)
_ActiveTermView()->DisableResizeView();
float mbHeight = fMenuBar->Bounds().Height() + 1;
fMenuBar->Show();
for (int32 i = fTabView->CountTabs() - 1; i >=0 ; i--)
_TermViewAt(i)->ScrollBar()->ResizeBy(0, -(B_H_SCROLL_BAR_HEIGHT - 1));

for (int32 i = fTabView->CountTabs() - 1; i >= 0 ; i--)
_TermViewAt(i)->ScrollBar()->ResizeBy(0,
-(B_H_SCROLL_BAR_HEIGHT - 1));

ResizeTo(fSavedFrame.Width(), fSavedFrame.Height());
MoveTo(fSavedFrame.left, fSavedFrame.top);
fTabView->ResizeBy(0, -mbHeight);
Expand Down Expand Up @@ -1648,6 +1657,16 @@ TermWindow::_UpdateSessionTitle(int32 index)
fTitle.title = windowTitle;
SetTitle(fTitle.title);
}

// If fullscreen, add a tooltip with the title and a keyboard shortcut hint
if (fFullScreen) {
BString toolTip(fTitle.title);
toolTip += "\n(";
toolTip += B_TRANSLATE("Full screen");
toolTip += " (ALT " UTF8_ENTER "))";
termView->SetToolTip(toolTip.String());
} else
termView->SetToolTip((const char *)NULL);
}


Expand Down

0 comments on commit ca0d271

Please sign in to comment.