Move settings into a separate window, prepare YouAds component for a native rewrite
This commit is contained in:
@@ -20,7 +20,7 @@ Button {
|
||||
background: Rectangle {
|
||||
color: parent.outlined ? "transparent" : (parent.hovered ? Colors.primaryAlt : Colors.primary)
|
||||
border.color: (parent.hovered ? "#555" : "#777")
|
||||
border.width: parent.outlined ? 2 : 0
|
||||
border.width: (parent.outlined || parent.focuesd) ? 2 : 0
|
||||
opacity: enabled ? 1 : 0.3
|
||||
radius: 5
|
||||
}
|
||||
|
||||
@@ -35,5 +35,8 @@ Slider {
|
||||
height: 20
|
||||
radius: 10
|
||||
color: Colors.primary
|
||||
|
||||
border.color: "#999"
|
||||
border.width: parent.focused ? 3 : 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ import QtQuick.Controls 6.8
|
||||
import QtQuick.Controls.Basic 6.8
|
||||
|
||||
TabButton {
|
||||
leftPadding: 5
|
||||
rightPadding: 5
|
||||
property bool outlined: false
|
||||
implicitHeight: 36
|
||||
|
||||
contentItem: Text {
|
||||
@@ -19,8 +18,10 @@ TabButton {
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: checked ? (parent.hovered ? Colors.secondaryAlt : Colors.secondary) : (parent.hovered ? Colors.primaryAlt : Colors.primary)
|
||||
color: parent.outlined ? "transparent" : (parent.hovered ? Colors.primaryAlt : Colors.primary)
|
||||
border.color: (parent.hovered ? "#555" : "#777")
|
||||
border.width: (parent.outlined || parent.focuesd) ? 2 : 0
|
||||
opacity: enabled ? 1 : 0.3
|
||||
radius: 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,14 @@
|
||||
import QtQuick 6.8
|
||||
import QtWebView 6.8
|
||||
|
||||
WebView {
|
||||
implicitWidth: 600
|
||||
implicitHeight: 150
|
||||
visible: false
|
||||
url: "https://youads.nonamesoft.xyz/ads/site"
|
||||
|
||||
settings.allowFileAccess: false
|
||||
settings.javaScriptEnabled: false
|
||||
settings.localContentCanAccessFileUrls: false
|
||||
settings.localStorageEnabled: false
|
||||
|
||||
onLoadingChanged: function(loadRequest) {
|
||||
visible = loadRequest.status == WebView.LoadSucceededStatus
|
||||
}
|
||||
Item {
|
||||
function fetchAd() {}
|
||||
|
||||
Timer {
|
||||
interval: 30 * 60 * 60
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: function() {
|
||||
parent.reload()
|
||||
parent.fetchAd()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#include "qyrcomponents.h"
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
QYRComponents::QYRComponents(QQuickItem *parent)
|
||||
: QQuickPaintedItem(parent)
|
||||
{
|
||||
// By default, QQuickItem does not draw anything. If you subclass
|
||||
// QQuickItem to create a visual item, you will need to uncomment the
|
||||
// following line and re-implement updatePaintNode()
|
||||
|
||||
// setFlag(ItemHasContents, true);
|
||||
}
|
||||
|
||||
void QYRComponents::paint(QPainter *painter)
|
||||
{
|
||||
QPen pen(QColorConstants::Red, 2);
|
||||
QBrush brush(QColorConstants::Red);
|
||||
|
||||
painter->setPen(pen);
|
||||
painter->setBrush(brush);
|
||||
painter->drawRect(0, 0, 100, 100);
|
||||
}
|
||||
|
||||
QYRComponents::~QYRComponents()
|
||||
{
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef QYRCOMPONENTS_H
|
||||
#define QYRCOMPONENTS_H
|
||||
|
||||
#include <QtQuick/QQuickPaintedItem>
|
||||
|
||||
class QYRComponents : public QQuickPaintedItem
|
||||
{
|
||||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
Q_DISABLE_COPY(QYRComponents)
|
||||
public:
|
||||
explicit QYRComponents(QQuickItem *parent = nullptr);
|
||||
void paint(QPainter *painter) override;
|
||||
~QYRComponents() override;
|
||||
};
|
||||
|
||||
#endif // QYRCOMPONENTS_H
|
||||
Reference in New Issue
Block a user