Ticket #5969: terminal2.diff
File terminal2.diff, 3.2 KB (added by , 14 years ago) |
---|
-
TermWindow.cpp
805 805 session->windowTitle = fInitialTitle; 806 806 fSessions.AddItem(session); 807 807 808 BTab *tab = new BTab;809 fTabView->AddTab(scrollView, tab);810 tab->SetLabel(session->name.String());811 // TODO: Use a better name. For example, do like MacOS X's Terminal812 // and update the title using the last executed command ?813 // Or like Gnome's Terminal and use the current path ?814 view->SetScrollBar(scrollView->ScrollBar(B_VERTICAL));815 view->SetMouseClipboard(gMouseClipboard);816 view->SetEncoding(EncodingID(817 PrefHandler::Default()->getString(PREF_TEXT_ENCODING)));818 819 BFont font;820 _GetPreferredFont(font);821 view->SetTermFont(&font);822 823 _SetTermColors(containerView);824 825 808 int width, height; 826 809 view->GetFontSize(&width, &height); 827 810 828 811 float minimumHeight = -1; 829 812 if (fMenubar) 830 813 minimumHeight += fMenubar->Bounds().Height() + 1; 831 if (fTabView && fTabView->CountTabs() > 1)814 if (fTabView && fTabView->CountTabs() > 0) 832 815 minimumHeight += fTabView->TabHeight() + 1; 833 816 SetSizeLimits(MIN_COLS * width - 1, MAX_COLS * width - 1, 834 817 minimumHeight + MIN_ROWS * height - 1, … … 837 820 // the terminal can be resized smaller than MIN_ROWS/MIN_COLS! 838 821 839 822 // If it's the first time we're called, setup the window 840 if (fTabView->CountTabs() == 1) {823 if (fTabView->CountTabs() == 0) { 841 824 float viewWidth, viewHeight; 842 825 containerView->GetPreferredSize(&viewWidth, &viewHeight); 843 826 … … 847 830 // NOTE: Width is one pixel too small, since the scroll view 848 831 // is one pixel wider than its parent. 849 832 } 833 834 BTab *tab = new BTab; 835 fTabView->AddTab(scrollView, tab); 836 tab->SetLabel(session->name.String()); 837 // TODO: Use a better name. For example, do like MacOS X's Terminal 838 // and update the title using the last executed command ? 839 // Or like Gnome's Terminal and use the current path ? 840 view->SetScrollBar(scrollView->ScrollBar(B_VERTICAL)); 841 view->SetMouseClipboard(gMouseClipboard); 842 view->SetEncoding(EncodingID( 843 PrefHandler::Default()->getString(PREF_TEXT_ENCODING))); 844 845 BFont font; 846 _GetPreferredFont(font); 847 view->SetTermFont(&font); 848 849 _SetTermColors(containerView); 850 850 851 // TODO: No fTabView->Select(tab); ? 851 852 fTabView->Select(fTabView->CountTabs() - 1); 852 853 } catch (...) { -
TermView.cpp
208 208 if (status != B_OK) 209 209 throw status; 210 210 211 ResizeToPreferred(); 212 211 213 // TODO: Don't show the dragger, since replicant capabilities 212 214 // don't work very well ATM. 213 215 /* … … 1026 1028 { 1027 1029 fMouseButtons = 0; 1028 1030 1031 // update the terminal size because it may have changed while the TermView 1032 // was detached from the window. On such conditions FrameResized was not 1033 // called when the resize occured 1034 int rows; 1035 int columns; 1036 GetTermSizeFromRect(Bounds(), &rows, &columns); 1037 SetTermSize(rows, columns); 1029 1038 MakeFocus(true); 1030 1039 if (fScrollBar) { 1031 1040 fScrollBar->SetSteps(fFontHeight, fFontHeight * fRows);