diff options
| author | matgic78 <matgic78@gmail.com> | 2010-03-31 15:15:31 +0200 | 
|---|---|---|
| committer | matgic78 <matgic78@gmail.com> | 2010-04-01 19:27:01 +0200 | 
| commit | bdc95a7a090c2cff888cc96dd612ba9449b01329 (patch) | |
| tree | f29dee897933820d46b43a9b0630e08fdf02cb4b | |
| parent | Remove limitation to the number of favorites. You are now able to add and rem... (diff) | |
| download | rekonq-bdc95a7a090c2cff888cc96dd612ba9449b01329.tar.xz | |
Button on top-right to add a preview
| -rw-r--r-- | src/data/home.html | 53 | ||||
| -rw-r--r-- | src/newtabpage.cpp | 20 | 
2 files changed, 57 insertions, 16 deletions
| diff --git a/src/data/home.html b/src/data/home.html index 96c0bd06..6b9cd383 100644 --- a/src/data/home.html +++ b/src/data/home.html @@ -49,23 +49,55 @@ color: black;  }  /* -------------------------------------------------------- */ -/* Navigation bar */ +/* Top bar */ -#navigation { +#top { +margin: 20px; +} + +.topBar {  display: inline-block; -margin: 2%;  border-width: 5px; +} + +#navigation {  -webkit-border-image: url(%2/bg2.png) 12 12 12 12  stretch stretch; +max-width: 75%; +} + +#actions, #balance { +margin-top: 12px; +width: 10%; +} + +#actions { +float: right; +} + +#balance { +display: hidden; float: left; +height: 16px;  }  .link {  display: inline-block;  } -.link img { -vertical-align: middle; margin-right: 5px; +.link img, .link span { +vertical-align: middle; display: inline-block;   } -.link a { -color: black;  +color: black; + +#actions .link { +-webkit-transition-property: opacity; +-webkit-transition-duration: 0.8s; +-webkit-transition-timing-function: ease; +opacity: 0.2; +} +#actions .link:hover { +opacity: 1; +} +#actions .link img { +margin-right: 3px; width: 16px;  }  .current{ @@ -161,7 +193,11 @@ margin-right: 5px;  <body>  <div id="rekonq-newtabpage"> -    <div id="navigation"></div> +    <div id="top"> +        <div class="topBar" id="balance"></div> <!-- This # is the same size as #actions to center #navigation --> +        <div class="topBar" id="navigation"></div> +        <div class="topBar" id="actions"></div> +    </div>      <div id="content">      </div>  </div> @@ -171,6 +207,7 @@ margin-right: 5px;      <div class="link">          <a href="">              <img src="" /> +            <span></span>          </a>      </div>      <div class="thumbnail"> diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 7d8787d7..98377d8a 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -158,8 +158,12 @@ void NewTabPage::favoritesPage()  {      m_root.addClass("favorites"); -    // TODO : create a nice button to replace this ugly link -    m_root.document().findFirst("#navigation").appendOutside("<a href=\"about:preview/add\">Add Preview</a>"); +    QWebElement add = markup(".link"); +    add.findFirst("a").setAttribute("href", "about:preview/add"); +    add.findFirst("img").setAttribute("src" , QString("file:///" +  +                                    KIconLoader::global()->iconPath("list-add", KIconLoader::Small || KIconLoader::SizeSmall))); +    add.findFirst("span").appendInside(i18n("Add Preview")); +    m_root.document().findFirst("#actions").appendInside(add);      QStringList names = ReKonfig::previewNames();      QStringList urls = ReKonfig::previewUrls(); @@ -334,35 +338,35 @@ void NewTabPage::browsingMenu(const KUrl ¤tUrl)      nav.findFirst("a").setAttribute("href", "about:favorites");      nav.findFirst("img").setAttribute("src" , QString("file:///" +       loader->iconPath("emblem-favorite", KIconLoader::Desktop ||KIconLoader::SizeSmall))); -    nav.findFirst("a").appendInside(i18n("Favorites")); +    nav.findFirst("span").appendInside(i18n("Favorites"));      navItems.append(nav);      nav = markup(".link"); // Closed Tabs      nav.findFirst("a").setAttribute("href", "about:closedTabs");      nav.findFirst("img").setAttribute("src" , QString("file:///" +       loader->iconPath("tab-close", KIconLoader::Desktop ||KIconLoader::SizeSmall))); -    nav.findFirst("a").appendInside(i18n("Closed Tabs")); +    nav.findFirst("span").appendInside(i18n("Closed Tabs"));      navItems.append(nav);      nav = markup(".link"); // Bookmarks      nav.findFirst("a").setAttribute("href", "about:bookmarks");      nav.findFirst("img").setAttribute("src" , QString("file:///" +       loader->iconPath("bookmarks", KIconLoader::Desktop ||KIconLoader::SizeSmall))); -    nav.findFirst("a").appendInside(i18n("Bookmarks")); +    nav.findFirst("span").appendInside(i18n("Bookmarks"));      navItems.append(nav);      nav = markup(".link"); // History      nav.findFirst("a").setAttribute("href", "about:history");      nav.findFirst("img").setAttribute("src" , QString("file:///" +       loader->iconPath("view-history", KIconLoader::Desktop ||KIconLoader::SizeSmall))); -    nav.findFirst("a").appendInside(i18n("History")); +    nav.findFirst("span").appendInside(i18n("History"));      navItems.append(nav); -    nav = markup(".link"); // History +    nav = markup(".link"); // Downloads      nav.findFirst("a").setAttribute("href", "about:downloads");      nav.findFirst("img").setAttribute("src" , QString("file:///" +       loader->iconPath("download", KIconLoader::Desktop ||KIconLoader::SizeSmall))); -    nav.findFirst("a").appendInside(i18n("Downloads")); +    nav.findFirst("span").appendInside(i18n("Downloads"));      navItems.append(nav);      QWebElement it; | 
