[banshee/stable-2.6] DapPropertiesDialog: Make sure progress bar value is valid (bgo#696700)
- From: Bertrand Lorentz <blorentz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/stable-2.6] DapPropertiesDialog: Make sure progress bar value is valid (bgo#696700)
- Date: Sun, 7 Apr 2013 20:07:58 +0000 (UTC)
commit 560d08a82f39a07c2ed0be47fd333b9bdf2d793a
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sun Apr 7 21:59:53 2013 +0200
DapPropertiesDialog: Make sure progress bar value is valid (bgo#696700)
.../Banshee.Dap.Gui/DapPropertiesDialog.cs | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs
b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs
index d439faa..a317b67 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapPropertiesDialog.cs
@@ -143,7 +143,8 @@ namespace Banshee.Dap
private ProgressBar UsedProgressBar {
get {
ProgressBar usedBar = new ProgressBar();
- usedBar.Fraction = (double)source.BytesUsed / (double)source.BytesCapacity;
+ double progress = (double)source.BytesUsed / (double)source.BytesCapacity;
+ usedBar.Fraction = Math.Max (0.0, Math.Min (1.0, progress));
usedBar.Text = String.Format (
Catalog.GetString("{0} of {1}"),
new Hyena.Query.FileSizeQueryValue (source.BytesUsed).ToUserQuery (),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]