Adding the option to get the program for free when

I choose to allow it.
This commit is contained in:
Sergiotarxz 2024-11-19 16:04:41 +01:00
parent 6a1c772cf6
commit af25d2fdc9
2 changed files with 35 additions and 22 deletions

View File

@ -300,7 +300,7 @@ sub _show_paywall( $self, $overlay ) {
my $inner_paywall_box = Gtk4::Box->new( 'vertical', 10 );
my $title = Gtk4::Label->new;
$title->set_markup('<big>This program is not activated</big>');
my $activate = Gtk4::Button->new_with_label('Pay and activate');
my $activate = Gtk4::Button->new_with_label('Activate');
my $about = Gtk4::Button->new_with_label('More about the program');
my $remind_me_later = Gtk4::Button->new_with_label('Remind me later');
$about->signal_connect(
@ -708,28 +708,36 @@ sub _on_receive_price($self) {
return;
}
my $box = Gtk4::Box->new( 'horizontal', 10 );
$box->set_halign('center');
my $discount_label = Gtk4::Label->new(undef);
$discount_label->set_markup("-$discount%");
$starting_price =~ s/^(.)$/0$1/;
$starting_price =~ s/(..)$/.$1/;
$starting_price =~ s/^\./0./;
$price =~ s/^(.)$/0$1/;
$price =~ s/(..)$/.$1/;
$price =~ s/^\./0./;
my $starting_price_label = Gtk4::Label->new;
$starting_price_label->set_markup("<small><s>$starting_price€</s></small>");
$discount_label->add_css_class('discount');
{
$box->set_halign('center');
$starting_price =~ s/^(.)$/0$1/;
$starting_price =~ s/(..)$/.$1/;
$starting_price =~ s/^\./0./;
if ($price < 2) {
my $label_free = Gtk4::Label->new(undef);
$label_free->set_markup("<big>Free now forever for limited time! Normal price: $starting_price</big>");
$box->append($label_free);
next;
}
my $discount_label = Gtk4::Label->new(undef);
$discount_label->set_markup("-$discount%");
$price =~ s/^(.)$/0$1/;
$price =~ s/(..)$/.$1/;
$price =~ s/^\./0./;
my $starting_price_label = Gtk4::Label->new;
$starting_price_label->set_markup("<small><s>$starting_price€</s></small>");
$discount_label->add_css_class('discount');
if ( !defined $price ) {
return;
}
my $price_label = Gtk4::Label->new(undef);
$price_label->set_markup("<big>$price€</big>");
$box->append($price_label);
if ( defined $discount && $discount > 2 ) {
$box->append($starting_price_label);
$box->append($discount_label);
if ( !defined $price ) {
return;
}
my $price_label = Gtk4::Label->new(undef);
$price_label->set_markup("<big>$price€</big>");
$box->append($price_label);
if ( defined $discount && $discount > 2 ) {
$box->append($starting_price_label);
$box->append($discount_label);
}
}
$window_price_discount->set_child($box);
}

View File

@ -30,6 +30,11 @@
<releases>
<release version="v1.0.15" date="2024-11-19">
<description>
<p>Adding the option to have free giveaways of the app.</p>
</description>
</release>
<release version="v1.0.14" date="2024-11-14">
<description>
<p>The required bluez API for Cat-Printers is not warranted to be there