mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-18 04:38:10 +02:00
Changes to bottom buttons UI on Apps page
This commit is contained in:
@@ -61,8 +61,6 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
var settingsProvider = context.watch<SettingsProvider>();
|
var settingsProvider = context.watch<SettingsProvider>();
|
||||||
var sourceProvider = SourceProvider();
|
var sourceProvider = SourceProvider();
|
||||||
var listedApps = appsProvider.getAppValues().toList();
|
var listedApps = appsProvider.getAppValues().toList();
|
||||||
var currentFilterIsUpdatesOnly =
|
|
||||||
filter.isIdenticalTo(updatesOnlyFilter, settingsProvider);
|
|
||||||
|
|
||||||
refresh() {
|
refresh() {
|
||||||
HapticFeedback.lightImpact();
|
HapticFeedback.lightImpact();
|
||||||
@@ -887,10 +885,17 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getMainBottomButtonsRow() {
|
getMainBottomButtons() {
|
||||||
return Row(
|
return [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
IconButton(
|
||||||
children: [
|
visualDensity: VisualDensity.compact,
|
||||||
|
onPressed: getMassObtainFunction(),
|
||||||
|
tooltip: selectedAppIds.isEmpty
|
||||||
|
? tr('installUpdateApps')
|
||||||
|
: tr('installUpdateSelectedApps'),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.file_download_outlined,
|
||||||
|
)),
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
onPressed: selectedAppIds.isEmpty
|
onPressed: selectedAppIds.isEmpty
|
||||||
@@ -902,15 +907,6 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
tooltip: tr('removeSelectedApps'),
|
tooltip: tr('removeSelectedApps'),
|
||||||
icon: const Icon(Icons.delete_outline_outlined),
|
icon: const Icon(Icons.delete_outline_outlined),
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
visualDensity: VisualDensity.compact,
|
|
||||||
onPressed: getMassObtainFunction(),
|
|
||||||
tooltip: selectedAppIds.isEmpty
|
|
||||||
? tr('installUpdateApps')
|
|
||||||
: tr('installUpdateSelectedApps'),
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.file_download_outlined,
|
|
||||||
)),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
onPressed: selectedAppIds.isEmpty ? null : launchCategorizeDialog(),
|
onPressed: selectedAppIds.isEmpty ? null : launchCategorizeDialog(),
|
||||||
@@ -923,8 +919,7 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
tooltip: tr('more'),
|
tooltip: tr('more'),
|
||||||
icon: const Icon(Icons.more_horiz),
|
icon: const Icon(Icons.more_horiz),
|
||||||
),
|
),
|
||||||
],
|
];
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showFilterDialog() async {
|
showFilterDialog() async {
|
||||||
@@ -997,50 +992,33 @@ class AppsPageState extends State<AppsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getFilterButtonsRow() {
|
getFilterButtonsRow() {
|
||||||
|
var isFilterOff = filter.isIdenticalTo(neutralFilter, settingsProvider);
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
getSelectAllButton(),
|
getSelectAllButton(),
|
||||||
const VerticalDivider(),
|
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: getMainBottomButtonsRow())),
|
|
||||||
const VerticalDivider(),
|
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () {
|
style: const ButtonStyle(visualDensity: VisualDensity.compact),
|
||||||
|
tooltip: isFilterOff ? tr('filter') : tr('filterActive'),
|
||||||
|
onPressed: isFilterOff
|
||||||
|
? showFilterDialog
|
||||||
|
: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (currentFilterIsUpdatesOnly) {
|
|
||||||
filter = AppsFilter();
|
filter = AppsFilter();
|
||||||
} else {
|
|
||||||
filter = updatesOnlyFilter;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
tooltip: currentFilterIsUpdatesOnly
|
icon: Icon(isFilterOff
|
||||||
? tr('removeOutdatedFilter')
|
? Icons.filter_list_rounded
|
||||||
: tr('showOutdatedOnly'),
|
: Icons.filter_list_off_rounded)),
|
||||||
icon: Icon(
|
const SizedBox(
|
||||||
currentFilterIsUpdatesOnly
|
width: 10,
|
||||||
? Icons.update_disabled_rounded
|
|
||||||
: Icons.update_rounded,
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
),
|
||||||
),
|
const VerticalDivider(),
|
||||||
TextButton.icon(
|
Expanded(
|
||||||
style: const ButtonStyle(visualDensity: VisualDensity.compact),
|
child: Row(
|
||||||
label: Text(
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
filter.isIdenticalTo(neutralFilter, settingsProvider)
|
children: getMainBottomButtons(),
|
||||||
? tr('filter')
|
)),
|
||||||
: tr('filterActive'),
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight:
|
|
||||||
filter.isIdenticalTo(neutralFilter, settingsProvider)
|
|
||||||
? FontWeight.normal
|
|
||||||
: FontWeight.bold),
|
|
||||||
),
|
|
||||||
onPressed: showFilterDialog,
|
|
||||||
icon: const Icon(Icons.filter_list_rounded))
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user