Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-power-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xfce
xfce4-power-manager
Commits
01d74ce2
Commit
01d74ce2
authored
15 years ago
by
Ali Abdallah
Browse files
Options
Downloads
Patches
Plain Diff
Fix icon refreshing, it should fix bug 5221
(Old svn revision: 7184)
parent
0fa5a18e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+3
-0
3 additions, 0 deletions
ChangeLog
src/xfpm-battery.c
+14
-17
14 additions, 17 deletions
src/xfpm-battery.c
with
17 additions
and
17 deletions
ChangeLog
+
3
−
0
View file @
01d74ce2
2009-04-13 21:23 Ali aliov@xfce.org
* : Fix icon refreshing, it should fix bug 5221
2009-04-12 22:54 Ali aliov@xfce.org
* : Provide the possibility to disable brightness control on key press by setting a xfconf property
...
...
This diff is collapsed.
Click to expand it.
src/xfpm-battery.c
+
14
−
17
View file @
01d74ce2
...
...
@@ -155,8 +155,6 @@ xfpm_battery_refresh_visible_icon (XfpmBattery *battery)
static
void
xfpm_battery_refresh_icon
(
XfpmBattery
*
battery
,
gboolean
is_present
,
gboolean
is_charging
,
gboolean
is_discharging
,
guint
percentage
)
{
...
...
@@ -166,42 +164,41 @@ xfpm_battery_refresh_icon (XfpmBattery *battery,
battery
->
priv
->
type
==
HAL_DEVICE_TYPE_UPS
?
"gpm-ups-missing"
:
"gpm-primary-missing"
);
return
;
}
/* Battery full */
if
(
!
is_charging
&&
!
is_discharging
)
if
(
battery
->
priv
->
state
==
BATTERY_FULLY_CHARGED
)
{
if
(
battery
->
priv
->
type
==
HAL_DEVICE_TYPE_PRIMARY
)
xfpm_tray_icon_set_icon
(
battery
->
priv
->
icon
,
"gpm-primary-charged"
);
xfpm_tray_icon_set_icon
(
battery
->
priv
->
icon
,
battery
->
priv
->
adapter_present
?
"gpm-primary-charged"
:
"gpm-primary-100"
);
else
{
gchar
*
icon
=
g_strdup_printf
(
"%s%s"
,
battery
->
priv
->
icon_prefix
,
xfpm_battery_get_icon_index
(
battery
->
priv
->
type
,
percentage
));
xfpm_battery_get_icon_index
(
battery
->
priv
->
type
,
percentage
));
xfpm_tray_icon_set_icon
(
battery
->
priv
->
icon
,
icon
);
g_free
(
icon
);
}
return
;
}
if
(
is_charging
)
else
if
(
battery
->
priv
->
state
==
BATTERY_IS_CHARGING
||
battery
->
priv
->
state
==
BATTERY_NOT_FULLY_CHARGED
)
{
gchar
*
icon
=
g_strdup_printf
(
"%s%s-%s"
,
battery
->
priv
->
icon_prefix
,
xfpm_battery_get_icon_index
(
battery
->
priv
->
type
,
percentage
),
xfpm_battery_get_icon_index
(
battery
->
priv
->
type
,
percentage
),
"charging"
);
xfpm_tray_icon_set_icon
(
battery
->
priv
->
icon
,
icon
);
g_free
(
icon
);
return
;
}
if
(
is_discharging
)
else
if
(
battery
->
priv
->
state
==
BATTERY_IS_DISCHARGING
||
battery
->
priv
->
state
==
BATTERY_CHARGE_CRITICAL
||
battery
->
priv
->
state
==
BATTERY_CHARGE_LOW
)
{
gchar
*
icon
=
g_strdup_printf
(
"%s%s"
,
battery
->
priv
->
icon_prefix
,
xfpm_battery_get_icon_index
(
battery
->
priv
->
type
,
percentage
));
xfpm_battery_get_icon_index
(
battery
->
priv
->
type
,
percentage
));
xfpm_tray_icon_set_icon
(
battery
->
priv
->
icon
,
icon
);
g_free
(
icon
);
return
;
}
}
...
...
@@ -420,7 +417,6 @@ xfpm_battery_refresh (XfpmBattery *battery)
"time"
,
&
time
,
NULL
);
xfpm_battery_refresh_icon
(
battery
,
is_present
,
is_charging
,
is_discharging
,
percentage
);
battery
->
priv
->
type
==
HAL_DEVICE_TYPE_PRIMARY
?
xfpm_battery_refresh_tooltip_primary
(
battery
,
is_present
,
is_charging
,
is_discharging
,
...
...
@@ -431,7 +427,8 @@ xfpm_battery_refresh (XfpmBattery *battery)
is_charging
,
is_discharging
,
last_full
,
current_charge
,
percentage
,
time
);
xfpm_battery_refresh_visible_icon
(
battery
);
xfpm_battery_refresh_icon
(
battery
,
is_present
,
percentage
);
xfpm_battery_refresh_visible_icon
(
battery
);
}
static
void
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment