guck

Vim-like QtWebEngine-powered browser, written in C++
git clone git://git.deurzen.net/guck
Log | Files | Refs | LICENSE

status.hh (1774B)


      1 #ifndef __GUCK__BROWSER__STATUSBAR__STATUS__GUARD__
      2 #define __GUCK__BROWSER__STATUSBAR__STATUS__GUARD__
      3 
      4 #include "../../defaults.hh"
      5 
      6 #include "command.hh"
      7 #include "text.hh"
      8 #include "url.hh"
      9 #include "position.hh"
     10 #include "backforward.hh"
     11 #include "tabindex.hh"
     12 #include "progress.hh"
     13 
     14 #include <QLineEdit>
     15 #include <QHBoxLayout>
     16 #include <QStackedLayout>
     17 
     18 
     19 typedef class status_t : public QWidget
     20 {
     21     Q_OBJECT
     22 
     23 public:
     24     status_t(QWidget& parent)
     25         : QWidget(&parent),
     26           m_parent(parent),
     27           m_layout(),
     28           m_stack(),
     29           m_command(*this),
     30           m_text(*this),
     31           m_url(*this),
     32           m_position(*this),
     33           m_backforward(*this),
     34           m_tabindex(*this),
     35           m_progress(*this)
     36     {
     37         QWidget::setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
     38         m_layout.setContentsMargins(0, 0, 0, 0);
     39         m_layout.setSpacing(5);
     40         m_layout.addLayout(&m_stack);
     41         m_stack.setContentsMargins(0, 0, 0, 0);
     42         m_stack.addWidget(&m_command);
     43         m_stack.addWidget(&m_text);
     44         m_layout.addWidget(&m_url);
     45         m_layout.addWidget(&m_position);
     46         m_layout.addWidget(&m_backforward);
     47         m_layout.addWidget(&m_tabindex);
     48         m_layout.addWidget(&m_progress);
     49         QWidget::setLayout(&m_layout);
     50     }
     51 
     52     void resize();
     53     void draw();
     54 
     55 protected slots:
     56     void on_tab_change();
     57     void on_set_text(const QString&);
     58 
     59 private:
     60     QWidget& m_parent;
     61 
     62     QHBoxLayout m_layout;
     63     QStackedLayout m_stack;
     64 
     65     command_t m_command;
     66     text_t m_text;
     67     url_t m_url;
     68     position_t m_position;
     69     backforward_t m_backforward;
     70     tabindex_t m_tabindex;
     71     progress_t m_progress;
     72 
     73 }* status_ptr_t;
     74 
     75 #endif//__GUCK__BROWSER__STATUSBAR__STATUS__GUARD__