From 2ede686495af5bfad719ef12d2f5770d2e09d822 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Tue, 21 Feb 2023 23:16:30 +0100 Subject: [PATCH] Split the button into two, copy url or open in tab Signed-off-by: Juraj Oravec --- Makefile | 1 + README.md | 3 +++ rssfinder/clipboard.svg | 34 +++++++++++++++++++++++++ rssfinder/main.qml | 56 +++++++++++++++++++++++++++++------------ 4 files changed, 78 insertions(+), 16 deletions(-) create mode 100644 rssfinder/clipboard.svg diff --git a/Makefile b/Makefile index 8fb7b9d..28c5032 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ FILES = $(PROJECT)/main.qml FILES += $(PROJECT)/finder.js FILES += $(PROJECT)/metadata.desktop FILES += $(PROJECT)/rss.svg +FILES += $(PROJECT)/clipboard.svg package: zip -X $(PROJECT)_v$(VERSION).zip $(FILES) diff --git a/README.md b/README.md index 76bccf5..e3f4e19 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,6 @@ Go to [Falkon store](https://store.falkon.org/p/1689113/) press `Install` and fo ### Manual Copy the `rssfinder` directory into `~/.config/falkon/plugins/` + +## Thanks to +The `clipboard` icon is talken from [SVG Repo](https://www.svgrepo.com/svg/260400/clipboard). diff --git a/rssfinder/clipboard.svg b/rssfinder/clipboard.svg new file mode 100644 index 0000000..879b00a --- /dev/null +++ b/rssfinder/clipboard.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rssfinder/main.qml b/rssfinder/main.qml index 2c09632..33b8c78 100644 --- a/rssfinder/main.qml +++ b/rssfinder/main.qml @@ -85,27 +85,51 @@ Falkon.PluginInterface { Component { id: contactsDelegate - Button { - hoverEnabled: true - onClicked: Falkon.Clipboard.copy(url) + RowLayout { + id: rowWrapper + spacing: 2 width: rssList.width - height: wrapper.height - ToolTip.delay: 1000 - ToolTip.timeout: 5000 - ToolTip.visible: hovered - ToolTip.text: i18n("Click to copy URL") + Button { + hoverEnabled: true + onClicked: Falkon.Tabs.addTab({ + url: url, + windowId: Falkon.Windows.getCurrent() + }) - ColumnLayout { - id: wrapper - spacing: 2 + ToolTip.visible: hovered + ToolTip.text: i18n("Open in new tab") - Label { - font.bold: true - text: title + Layout.fillWidth: true + Layout.fillHeight: true + + contentItem: ColumnLayout { + Label { + font.bold: true + topPadding: 5 + leftPadding: 5 + text: title + } + Label { + leftPadding: 5 + bottomPadding: 5 + text: url + } } - Label { - text: url + } + + Button { + hoverEnabled: true + onClicked: Falkon.Clipboard.copy(url) + + ToolTip.visible: hovered + ToolTip.text: i18n("Copy URL") + + Layout.fillHeight: true + + contentItem: Image { + source: 'clipboard.svg' + sourceSize.height: parent.height } } }