From bdc95a7a090c2cff888cc96dd612ba9449b01329 Mon Sep 17 00:00:00 2001 From: matgic78 Date: Wed, 31 Mar 2010 15:15:31 +0200 Subject: Button on top-right to add a preview --- src/data/home.html | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- src/newtabpage.cpp | 20 ++++++++++++-------- 2 files changed, 57 insertions(+), 16 deletions(-) (limited to 'src') 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;
- +
+
+ +
+
@@ -171,6 +207,7 @@ margin-right: 5px;
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("Add Preview"); + 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; -- cgit v1.2.1