guck

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

tab.cc (438B)


      1 #include "tab.hh"
      2 
      3 #include <QString>
      4 
      5 
      6 void
      7 tab_t::resize()
      8 {
      9     auto size = m_parent.size();
     10     if (size.height() > TAB_HEIGHT + STATUSBAR_HEIGHT)
     11         QWebEngineView::resize(size.width(),
     12             size.height() - TAB_HEIGHT - STATUSBAR_HEIGHT);
     13 }
     14 
     15 void
     16 tab_t::open(const std::string&& url)
     17 {
     18     open(QUrl(url.c_str()));
     19 }
     20 
     21 void
     22 tab_t::open(QUrl url)
     23 {
     24     if (!url.isValid())
     25         return;
     26 
     27     QWebEngineView::load(url);
     28 }