2 * This file is part of NeighborNote
3 * Copyright 2013 Yuki Takahashi
5 * This file may be licensed under the terms of of the
6 * GNU General Public License Version 2 (the ``GPL'').
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.
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.
21 package cx.fbn.nevernote.gui;
23 import com.trolltech.qt.core.Qt;
24 import com.trolltech.qt.gui.QLabel;
25 import com.trolltech.qt.gui.QTabBar;
27 public class TabBrowserBar extends QTabBar {
29 public TabBrowserBar(){
33 public void addNewTab(int index, String title){
34 QLabel label = new QLabel(title);
35 label.setAlignment(Qt.AlignmentFlag.AlignLeft);
36 int tabWidth = this.tabSizeHint(index).width();
37 label.setFixedWidth(tabWidth - 35);
38 this.setTabButton(index, QTabBar.ButtonPosition.LeftSide, label);
41 public void setTabTitle(int index, String title) {
42 QLabel label = (QLabel)this.tabButton(index, QTabBar.ButtonPosition.LeftSide);