swift
cockpitinfoareacomponent.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include <QTabWidget>
7 #include <QtGlobal>
8 
9 #include "ui_cockpitinfoareacomponent.h"
10 
11 #include "gui/infoarea.h"
12 #include "misc/icons.h"
13 
14 using namespace swift::misc;
15 
16 namespace swift::gui::components
17 {
18  CCockpitInfoAreaComponent::CCockpitInfoAreaComponent(QWidget *parent)
19  : CInfoArea(parent), ui(new Ui::CCockpitInfoAreaComponent)
20  {
21  ui->setupUi(this);
22  this->initInfoArea();
23  this->setTabBarPosition(QTabWidget::North);
24  this->toggleTabBarLocked(true);
25  }
26 
28 
30  {
31  // see also CMainInfoAreaComponent::getPreferredSizeWhenFloating
32  Q_UNUSED(areaIndex)
33  return QSize(600, 400);
34  }
35 
36  const QPixmap &CCockpitInfoAreaComponent::indexToPixmap(int areaIndex) const
37  {
38  const InfoArea area = static_cast<InfoArea>(areaIndex);
39  switch (area)
40  {
41  case InfoAreaAudio: return CIcons::appAudio16();
42  case InfoAreaNotifications: return CIcons::appVoiceRooms16();
43  case InfoAreaAdvanced: return CIcons::appSettings16();
44  default: return CIcons::empty();
45  }
46  }
47 
48 } // namespace swift::gui::components
Info area, hosting dockable widgets.
Definition: infoarea.h:41
void setTabBarPosition(QTabWidget::TabPosition position)
Tab position for docked widgets tab.
Definition: infoarea.cpp:874
void initInfoArea()
Init area after(!) GUI is initialized.
Definition: infoarea.cpp:47
void toggleTabBarLocked(bool locked)
Toogle lock tabbar.
Definition: infoarea.cpp:872
The cockpit itself is part of the main info area, but itself also an info area. hence windows can be ...
virtual const QPixmap & indexToPixmap(int areaIndex) const
Info area (index) to icon.
virtual QSize getPreferredSizeWhenFloating(int areaIndex) const
Preferred size when floating (size hint)
High level reusable GUI components.
Definition: aboutdialog.cpp:13
Free functions in swift::misc.