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)
|
||||
- Christian Ruppert <Spooky85@gmail.com> (autotools build system)
|
||||
- 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/)
|
||||
- 2007-2008 Pål Staurland <staura@gmail.com>
|
||||
|
|
|
@ -42,6 +42,7 @@ include_directories( ${PROJECT_BINARY_DIR}
|
|||
src/launcher
|
||||
src/tooltip
|
||||
src/util
|
||||
src/freespace
|
||||
${X11_INCLUDE_DIRS}
|
||||
${PANGOCAIRO_INCLUDE_DIRS}
|
||||
${PANGO_INCLUDE_DIRS}
|
||||
|
@ -67,7 +68,8 @@ set( SOURCES src/config.c
|
|||
src/taskbar/taskbar.c
|
||||
src/taskbar/taskbarname.c
|
||||
src/tooltip/tooltip.c
|
||||
src/util/area.c
|
||||
src/freespace/freespace.c
|
||||
src/util/area.c
|
||||
src/util/common.c
|
||||
src/util/strnatcmp.c
|
||||
src/util/timer.c
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
- taskbar_hide_inactive_tasks
|
||||
- taskbar_sort_order
|
||||
- taskbar_name (already released by distros)
|
||||
- task_align (already released by distros)
|
||||
- Launcher:
|
||||
- launcher* (already released by distros)
|
||||
- launcher_apps_dir (previously patched in by some distros)
|
||||
|
@ -34,6 +35,7 @@
|
|||
- launcher_icon_theme_override
|
||||
- System tray:
|
||||
- systray_monitor
|
||||
- Freespace (already released by distros)
|
||||
- Config options with changed behavior:
|
||||
- Panel:
|
||||
- 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')
|
||||
init_clock_panel(p);
|
||||
if (panel_items_order[k] == 'F')
|
||||
init_freespace_panel(p);
|
||||
}
|
||||
set_panel_items_order(p);
|
||||
|
||||
|
@ -322,13 +324,13 @@ void init_panel_size_and_position(Panel *panel)
|
|||
|
||||
int resize_panel(void *obj)
|
||||
{
|
||||
resize_by_layout(obj, 0);
|
||||
Panel *panel = (Panel*)obj;
|
||||
resize_by_layout(panel, 0);
|
||||
|
||||
//printf("resize_panel\n");
|
||||
if (panel_mode != MULTI_DESKTOP && taskbar_enabled) {
|
||||
// propagate width/height on hidden taskbar
|
||||
int i, width, height;
|
||||
Panel *panel = (Panel*)obj;
|
||||
width = panel->taskbar[server.desktop].area.width;
|
||||
height = panel->taskbar[server.desktop].area.height;
|
||||
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) {
|
||||
// Distribute the available space between taskbars
|
||||
Panel *panel = (Panel*)obj;
|
||||
|
||||
// Compute the total available size, and the total size requested by the taskbars
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -505,6 +508,8 @@ void set_panel_items_order(Panel *p)
|
|||
}
|
||||
if (panel_items_order[k] == 'C')
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "taskbar.h"
|
||||
#include "systraybar.h"
|
||||
#include "launcher.h"
|
||||
#include "freespace.h"
|
||||
|
||||
#ifdef ENABLE_BATTERY
|
||||
#include "battery.h"
|
||||
|
@ -116,6 +117,8 @@ typedef struct {
|
|||
|
||||
Launcher launcher;
|
||||
|
||||
FreeSpace freespace;
|
||||
|
||||
// autohide
|
||||
int is_hidden;
|
||||
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"),
|
||||
itemsColValue, "L",
|
||||
-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();
|
||||
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') {
|
||||
value = "L";
|
||||
name = _("Launcher");
|
||||
} else if (v == 'F') {
|
||||
value = "F";
|
||||
name = _("Free space");
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue