| 35 | } |
| 36 | |
| 37 | StatusBar::StatusBar(QWidget* parent) |
| 38 | : QStatusBar(parent) |
| 39 | , m_timer(new QTimer(this)) |
| 40 | { |
| 41 | #ifdef Q_OS_MAC |
| 42 | /* At time of writing this is only required for OSX and only has effect on OSX. |
| 43 | ifdef for robustness to future platform dependent theme/widget changes |
| 44 | https://phabricator.kde.org/D656 |
| 45 | */ |
| 46 | setStyleSheet(QStringLiteral("QStatusBar{background:transparent;}")); |
| 47 | #endif |
| 48 | |
| 49 | m_timer->setSingleShot(true); |
| 50 | connect(m_timer, &QTimer::timeout, this, &StatusBar::slotTimeout); |
| 51 | connect(Core::self()->pluginController(), &IPluginController::pluginLoaded, this, &StatusBar::pluginLoaded); |
| 52 | const QList<IPlugin*> plugins = Core::self()->pluginControllerInternal()->allPluginsForExtension(QStringLiteral("IStatus")); |
| 53 | |
| 54 | for (IPlugin* plugin : plugins) { |
| 55 | registerStatus(plugin); |
| 56 | } |
| 57 | |
| 58 | registerStatus(Core::self()->languageController()->backgroundParser()); |
| 59 | |
| 60 | m_progressController = Core::self()->progressController(); |
| 61 | m_progressDialog = new ProgressDialog(this, parent); // construct this first, then progressWidget |
| 62 | m_progressDialog->setVisible(false); |
| 63 | m_progressWidget = new StatusbarProgressWidget(m_progressDialog, this); |
| 64 | // Fix the progress widget's width to leave the rest of the horizontal space to status messages. |
| 65 | m_progressWidget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); |
| 66 | |
| 67 | addPermanentWidget(m_progressWidget, 0); |
| 68 | } |
| 69 | |
| 70 | StatusBar::~StatusBar() = default; |
| 71 |
nothing calls this directly
no test coverage detected