[haiku-commits] haiku: hrev44767 - src/apps/terminal

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 5 Nov 2012 20:04:52 +0100 (CET)

hrev44767 adds 1 changeset to branch 'master'
old head: 8ef01bd74e313b9b1e9732a76f91c59deeca8a02
new head: ca0d271159445d49707998406c66e97c9d9e61c9

----------------------------------------------------------------------------

ca0d271: Terminal: Add a tooltip when in fullscreen mode
  
  * 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

                                          [ FranÃois Revol <revol@xxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44767
Commit:      ca0d271159445d49707998406c66e97c9d9e61c9
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ca0d271
Author:      FranÃois Revol <revol@xxxxxxx>
Date:        Mon Nov  5 19:01:51 2012 UTC

Ticket:      https://dev.haiku-os.org/ticket/7356

----------------------------------------------------------------------------

1 file changed, 24 insertions(+), 5 deletions(-)
src/apps/terminal/TermWindow.cpp | 29 ++++++++++++++++++++++++-----

----------------------------------------------------------------------------

diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp
index f039c95..19cdf27 100644
--- a/src/apps/terminal/TermWindow.cpp
+++ b/src/apps/terminal/TermWindow.cpp
@@ -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
 
@@ -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);
@@ -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);
@@ -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);
 }
 
 


Other related posts:

  • » [haiku-commits] haiku: hrev44767 - src/apps/terminal - revol