OSDN Git Service

クリーンアップ
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / gui / TabBrowserBar.java
1 /*
2  * This file is part of NeighborNote
3  * Copyright 2013 Yuki Takahashi
4  * 
5  * This file may be licensed under the terms of of the
6  * GNU General Public License Version 2 (the ``GPL'').
7  *
8  * Software distributed under the License is distributed
9  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
10  * express or implied. See the GPL for the specific language
11  * governing rights and limitations.
12  *
13  * You should have received a copy of the GPL along with this
14  * program. If not, go to http://www.gnu.org/licenses/gpl.html
15  * or write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18 */
19
20 package cx.fbn.nevernote.gui;
21
22 import com.trolltech.qt.core.Qt;
23 import com.trolltech.qt.gui.QLabel;
24 import com.trolltech.qt.gui.QTabBar;
25
26 public class TabBrowserBar extends QTabBar {
27
28         public TabBrowserBar(){
29                 super();
30         }
31
32         public void addNewTab(int index, String title){
33                 QLabel label = new QLabel(title);
34                 label.setAlignment(Qt.AlignmentFlag.AlignLeft);
35                 int tabWidth = this.tabSizeHint(index).width();
36                 label.setFixedWidth(tabWidth - 35);
37                 this.setTabButton(index, QTabBar.ButtonPosition.LeftSide, label);
38         }
39
40         public void setTabTitle(int index, String title) {
41                 QLabel label = (QLabel)this.tabButton(index, QTabBar.ButtonPosition.LeftSide);
42                 label.setText(title);
43         }
44         
45 }