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

View File

@ -30,6 +30,11 @@
<releases> <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"> <release version="v1.0.14" date="2024-11-14">
<description> <description>
<p>The required bluez API for Cat-Printers is not warranted to be there <p>The required bluez API for Cat-Printers is not warranted to be there