Free space item
This commit is contained in:
parent
df1f2d4e4b
commit
b1b95e086d
7 changed files with 287 additions and 262 deletions
1
AUTHORS
1
AUTHORS
|
@ -5,6 +5,7 @@ tint2 is developped by :
|
||||||
- Euan Freeman <euan04@gmail.com> (tintwizard)
|
- Euan Freeman <euan04@gmail.com> (tintwizard)
|
||||||
- Christian Ruppert <Spooky85@gmail.com> (autotools build system)
|
- Christian Ruppert <Spooky85@gmail.com> (autotools build system)
|
||||||
- Ovidiu M <mrovi9000 at gmail.com> : launcher, bug fixes
|
- Ovidiu M <mrovi9000 at gmail.com> : launcher, bug fixes
|
||||||
|
- Mishael A Sibiryakov (death@junki.org) : freespace
|
||||||
|
|
||||||
tint2 is based on ttm source code (http://code.google.com/p/ttm/)
|
tint2 is based on ttm source code (http://code.google.com/p/ttm/)
|
||||||
- 2007-2008 Pål Staurland <staura@gmail.com>
|
- 2007-2008 Pål Staurland <staura@gmail.com>
|
||||||
|
|
|
@ -42,6 +42,7 @@ include_directories( ${PROJECT_BINARY_DIR}
|
||||||
src/launcher
|
src/launcher
|
||||||
src/tooltip
|
src/tooltip
|
||||||
src/util
|
src/util
|
||||||
|
src/freespace
|
||||||
${X11_INCLUDE_DIRS}
|
${X11_INCLUDE_DIRS}
|
||||||
${PANGOCAIRO_INCLUDE_DIRS}
|
${PANGOCAIRO_INCLUDE_DIRS}
|
||||||
${PANGO_INCLUDE_DIRS}
|
${PANGO_INCLUDE_DIRS}
|
||||||
|
@ -67,7 +68,8 @@ set( SOURCES src/config.c
|
||||||
src/taskbar/taskbar.c
|
src/taskbar/taskbar.c
|
||||||
src/taskbar/taskbarname.c
|
src/taskbar/taskbarname.c
|
||||||
src/tooltip/tooltip.c
|
src/tooltip/tooltip.c
|
||||||
src/util/area.c
|
src/freespace/freespace.c
|
||||||
|
src/util/area.c
|
||||||
src/util/common.c
|
src/util/common.c
|
||||||
src/util/strnatcmp.c
|
src/util/strnatcmp.c
|
||||||
src/util/timer.c
|
src/util/timer.c
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
- taskbar_hide_inactive_tasks
|
- taskbar_hide_inactive_tasks
|
||||||
- taskbar_sort_order
|
- taskbar_sort_order
|
||||||
- taskbar_name (already released by distros)
|
- taskbar_name (already released by distros)
|
||||||
|
- task_align (already released by distros)
|
||||||
- Launcher:
|
- Launcher:
|
||||||
- launcher* (already released by distros)
|
- launcher* (already released by distros)
|
||||||
- launcher_apps_dir (previously patched in by some distros)
|
- launcher_apps_dir (previously patched in by some distros)
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
- launcher_icon_theme_override
|
- launcher_icon_theme_override
|
||||||
- System tray:
|
- System tray:
|
||||||
- systray_monitor
|
- systray_monitor
|
||||||
|
- Freespace (already released by distros)
|
||||||
- Config options with changed behavior:
|
- Config options with changed behavior:
|
||||||
- Panel:
|
- Panel:
|
||||||
- panel_dock: previously, 'panel_dock = 1' was actually not placing the panel into the dock. This option now
|
- panel_dock: previously, 'panel_dock = 1' was actually not placing the panel into the dock. This option now
|
||||||
|
|
11
src/panel.c
11
src/panel.c
|
@ -204,6 +204,8 @@ void init_panel()
|
||||||
}
|
}
|
||||||
if (panel_items_order[k] == 'C')
|
if (panel_items_order[k] == 'C')
|
||||||
init_clock_panel(p);
|
init_clock_panel(p);
|
||||||
|
if (panel_items_order[k] == 'F')
|
||||||
|
init_freespace_panel(p);
|
||||||
}
|
}
|
||||||
set_panel_items_order(p);
|
set_panel_items_order(p);
|
||||||
|
|
||||||
|
@ -322,13 +324,13 @@ void init_panel_size_and_position(Panel *panel)
|
||||||
|
|
||||||
int resize_panel(void *obj)
|
int resize_panel(void *obj)
|
||||||
{
|
{
|
||||||
resize_by_layout(obj, 0);
|
Panel *panel = (Panel*)obj;
|
||||||
|
resize_by_layout(panel, 0);
|
||||||
|
|
||||||
//printf("resize_panel\n");
|
//printf("resize_panel\n");
|
||||||
if (panel_mode != MULTI_DESKTOP && taskbar_enabled) {
|
if (panel_mode != MULTI_DESKTOP && taskbar_enabled) {
|
||||||
// propagate width/height on hidden taskbar
|
// propagate width/height on hidden taskbar
|
||||||
int i, width, height;
|
int i, width, height;
|
||||||
Panel *panel = (Panel*)obj;
|
|
||||||
width = panel->taskbar[server.desktop].area.width;
|
width = panel->taskbar[server.desktop].area.width;
|
||||||
height = panel->taskbar[server.desktop].area.height;
|
height = panel->taskbar[server.desktop].area.height;
|
||||||
for (i=0 ; i < panel->nb_desktop ; i++) {
|
for (i=0 ; i < panel->nb_desktop ; i++) {
|
||||||
|
@ -339,7 +341,6 @@ int resize_panel(void *obj)
|
||||||
}
|
}
|
||||||
if (panel_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) {
|
if (panel_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) {
|
||||||
// Distribute the available space between taskbars
|
// Distribute the available space between taskbars
|
||||||
Panel *panel = (Panel*)obj;
|
|
||||||
|
|
||||||
// Compute the total available size, and the total size requested by the taskbars
|
// Compute the total available size, and the total size requested by the taskbars
|
||||||
int total_size = 0;
|
int total_size = 0;
|
||||||
|
@ -418,6 +419,8 @@ int resize_panel(void *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (panel->freespace.area.on_screen)
|
||||||
|
panel->freespace.area.resize = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,6 +508,8 @@ void set_panel_items_order(Panel *p)
|
||||||
}
|
}
|
||||||
if (panel_items_order[k] == 'C')
|
if (panel_items_order[k] == 'C')
|
||||||
p->area.list = g_list_append(p->area.list, &p->clock);
|
p->area.list = g_list_append(p->area.list, &p->clock);
|
||||||
|
if (panel_items_order[k] == 'F')
|
||||||
|
p->area.list = g_list_append(p->area.list, &p->freespace);
|
||||||
}
|
}
|
||||||
init_rendering(&p->area, 0);
|
init_rendering(&p->area, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "taskbar.h"
|
#include "taskbar.h"
|
||||||
#include "systraybar.h"
|
#include "systraybar.h"
|
||||||
#include "launcher.h"
|
#include "launcher.h"
|
||||||
|
#include "freespace.h"
|
||||||
|
|
||||||
#ifdef ENABLE_BATTERY
|
#ifdef ENABLE_BATTERY
|
||||||
#include "battery.h"
|
#include "battery.h"
|
||||||
|
@ -116,6 +117,8 @@ typedef struct {
|
||||||
|
|
||||||
Launcher launcher;
|
Launcher launcher;
|
||||||
|
|
||||||
|
FreeSpace freespace;
|
||||||
|
|
||||||
// autohide
|
// autohide
|
||||||
int is_hidden;
|
int is_hidden;
|
||||||
int hidden_width, hidden_height;
|
int hidden_width, hidden_height;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1263,6 +1263,11 @@ void create_panel_items(GtkWidget *parent)
|
||||||
itemsColName, _("Launcher"),
|
itemsColName, _("Launcher"),
|
||||||
itemsColValue, "L",
|
itemsColValue, "L",
|
||||||
-1);
|
-1);
|
||||||
|
gtk_list_store_append(all_items, &iter);
|
||||||
|
gtk_list_store_set(all_items, &iter,
|
||||||
|
itemsColName, _("Free space"),
|
||||||
|
itemsColValue, "F",
|
||||||
|
-1);
|
||||||
|
|
||||||
panel_items_view = gtk_tree_view_new();
|
panel_items_view = gtk_tree_view_new();
|
||||||
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(panel_items_view),
|
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(panel_items_view),
|
||||||
|
@ -1441,6 +1446,9 @@ void set_panel_items(const char *items)
|
||||||
} else if (v == 'L') {
|
} else if (v == 'L') {
|
||||||
value = "L";
|
value = "L";
|
||||||
name = _("Launcher");
|
name = _("Launcher");
|
||||||
|
} else if (v == 'F') {
|
||||||
|
value = "F";
|
||||||
|
name = _("Free space");
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue