mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
cwd input line works/filter handling works/clipping label widget/flashing removed -mig
This commit is contained in:
parent
38f7b63645
commit
f29db51778
@ -1,3 +1,13 @@
|
|||||||
|
1998-03-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||||
|
|
||||||
|
* gscreen.c (x_fill_panel): Colors are properly displayed now.
|
||||||
|
|
||||||
|
Use the clipped labels.
|
||||||
|
|
||||||
|
* gcliplabel.c, gcliplabel.h: Derived label that does label
|
||||||
|
clipping (it does not request the allocation for the whole string,
|
||||||
|
but settles with whatever is provided in the size_allocation).
|
||||||
|
|
||||||
1998-03-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
1998-03-23 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gtrans.c (create_transparent_text_window): Set the window's
|
* gtrans.c (create_transparent_text_window): Set the window's
|
||||||
|
@ -31,7 +31,8 @@ GNOMESRCS = \
|
|||||||
gcmd.c \
|
gcmd.c \
|
||||||
gprop.c \
|
gprop.c \
|
||||||
gmc-chargrid.c \
|
gmc-chargrid.c \
|
||||||
gpageprop.c
|
gpageprop.c \
|
||||||
|
gcliplabel.c
|
||||||
|
|
||||||
GNOMEHDRS = \
|
GNOMEHDRS = \
|
||||||
gmain.h \
|
gmain.h \
|
||||||
@ -42,7 +43,8 @@ GNOMEHDRS = \
|
|||||||
gcmd.h \
|
gcmd.h \
|
||||||
gprop.h \
|
gprop.h \
|
||||||
gpageprop.h \
|
gpageprop.h \
|
||||||
gmc-chargrid.h
|
gmc-chargrid.h \
|
||||||
|
gcliplabel.h
|
||||||
|
|
||||||
ICONS = \
|
ICONS = \
|
||||||
$(srcdir)/directory-ok.xpm \
|
$(srcdir)/directory-ok.xpm \
|
||||||
@ -83,7 +85,8 @@ OBJS = $(LOBJS) $(OOBJS) \
|
|||||||
gmc-chargrid.o \
|
gmc-chargrid.o \
|
||||||
gview.o \
|
gview.o \
|
||||||
gprop.o \
|
gprop.o \
|
||||||
gpageprop.o
|
gpageprop.o \
|
||||||
|
gcliplabel.o
|
||||||
|
|
||||||
#
|
#
|
||||||
# Distribution variables
|
# Distribution variables
|
||||||
|
137
gnome/gcliplabel.c
Normal file
137
gnome/gcliplabel.c
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* (C) 1998 The Free Software Foundation
|
||||||
|
*
|
||||||
|
* Author: Miguel de Icaza (miguel@kernel.org)
|
||||||
|
*
|
||||||
|
* Clipped label: This label is differnt from the one on Gtk as it
|
||||||
|
* does requests no space, but uses all that is given to it.
|
||||||
|
*
|
||||||
|
* It does not queue an resize when changing the text.
|
||||||
|
* */
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include "gcliplabel.h"
|
||||||
|
|
||||||
|
|
||||||
|
static void gtk_clip_label_class_init (GtkClipLabelClass *klass);
|
||||||
|
static void gtk_clip_label_size_request (GtkWidget *widget,
|
||||||
|
GtkRequisition *requisition);
|
||||||
|
static void gtk_clip_label_size_allocate (GtkWidget *widget,
|
||||||
|
GtkAllocation *allocation);
|
||||||
|
|
||||||
|
static GtkLabelClass *parent_class = NULL;
|
||||||
|
|
||||||
|
guint
|
||||||
|
gtk_clip_label_get_type ()
|
||||||
|
{
|
||||||
|
static guint label_type = 0;
|
||||||
|
|
||||||
|
if (!label_type)
|
||||||
|
{
|
||||||
|
GtkTypeInfo clip_label_info =
|
||||||
|
{
|
||||||
|
"GtkClipLabel",
|
||||||
|
sizeof (GtkClipLabel),
|
||||||
|
sizeof (GtkClipLabelClass),
|
||||||
|
(GtkClassInitFunc) gtk_clip_label_class_init,
|
||||||
|
(GtkObjectInitFunc) NULL,
|
||||||
|
(GtkArgSetFunc) NULL,
|
||||||
|
(GtkArgGetFunc) NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
label_type = gtk_type_unique (gtk_label_get_type (), &clip_label_info);
|
||||||
|
}
|
||||||
|
|
||||||
|
return label_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_clip_label_class_init (GtkClipLabelClass *class)
|
||||||
|
{
|
||||||
|
GtkWidgetClass *widget_class;
|
||||||
|
|
||||||
|
parent_class = gtk_type_class (gtk_label_get_type ());
|
||||||
|
|
||||||
|
widget_class = (GtkWidgetClass*) class;
|
||||||
|
widget_class->size_request = gtk_clip_label_size_request;
|
||||||
|
widget_class->size_allocate = gtk_clip_label_size_allocate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_clip_label_set (GtkLabel *label,
|
||||||
|
const char *str)
|
||||||
|
{
|
||||||
|
char* p;
|
||||||
|
|
||||||
|
g_return_if_fail (label != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_LABEL (label));
|
||||||
|
g_return_if_fail (str != NULL);
|
||||||
|
|
||||||
|
if (label->label)
|
||||||
|
g_free (label->label);
|
||||||
|
label->label = g_strdup (str);
|
||||||
|
|
||||||
|
if (label->row)
|
||||||
|
g_slist_free (label->row);
|
||||||
|
label->row = NULL;
|
||||||
|
label->row = g_slist_append (label->row, label->label);
|
||||||
|
p = label->label;
|
||||||
|
while ((p = strchr(p, '\n')))
|
||||||
|
label->row = g_slist_append (label->row, ++p);
|
||||||
|
|
||||||
|
if (GTK_WIDGET_VISIBLE (label))
|
||||||
|
{
|
||||||
|
if (GTK_WIDGET_MAPPED (label))
|
||||||
|
gdk_window_clear_area (GTK_WIDGET (label)->window,
|
||||||
|
GTK_WIDGET (label)->allocation.x,
|
||||||
|
GTK_WIDGET (label)->allocation.y,
|
||||||
|
GTK_WIDGET (label)->allocation.width,
|
||||||
|
GTK_WIDGET (label)->allocation.height);
|
||||||
|
gtk_widget_queue_draw (GTK_WIDGET (label));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GtkWidget*
|
||||||
|
gtk_clip_label_new (const char *str)
|
||||||
|
{
|
||||||
|
GtkClipLabel *label;
|
||||||
|
|
||||||
|
g_return_val_if_fail (str != NULL, NULL);
|
||||||
|
|
||||||
|
label = gtk_type_new (gtk_clip_label_get_type ());
|
||||||
|
|
||||||
|
gtk_label_set (GTK_LABEL (label), str);
|
||||||
|
|
||||||
|
return GTK_WIDGET (label);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_clip_label_size_request (GtkWidget *widget,
|
||||||
|
GtkRequisition *requisition)
|
||||||
|
{
|
||||||
|
GtkClipLabel *label;
|
||||||
|
GSList *row;
|
||||||
|
|
||||||
|
g_return_if_fail (widget != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CLIP_LABEL (widget));
|
||||||
|
g_return_if_fail (requisition != NULL);
|
||||||
|
|
||||||
|
label = GTK_CLIP_LABEL (widget);
|
||||||
|
|
||||||
|
((GtkWidgetClass *)parent_class)->size_request (widget, requisition);
|
||||||
|
|
||||||
|
requisition->width = GTK_LABEL (label)->misc.xpad * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_clip_label_size_allocate (GtkWidget *widget,
|
||||||
|
GtkAllocation *alloc)
|
||||||
|
{
|
||||||
|
((GtkWidgetClass *)parent_class)->size_allocate (widget, alloc);
|
||||||
|
|
||||||
|
widget->requisition.width = alloc->width;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
42
gnome/gcliplabel.h
Normal file
42
gnome/gcliplabel.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#ifndef __GTK_CLIP_LABEL_H__
|
||||||
|
#define __GTK_CLIP_LABEL_H__
|
||||||
|
|
||||||
|
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
#include <gtk/gtklabel.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
|
||||||
|
#define GTK_CLIP_LABEL(obj) GTK_CHECK_CAST (obj, gtk_clip_label_get_type (), GtkClipLabel)
|
||||||
|
#define GTK_CLIP_LABEL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_clip_label_get_type (), GtkClipLabelClass)
|
||||||
|
#define GTK_IS_CLIP_LABEL(obj) GTK_CHECK_TYPE (obj, gtk_clip_label_get_type ())
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _GtkClipLabel GtkClipLabel;
|
||||||
|
typedef struct _GtkClipLabelClass GtkClipLabelClass;
|
||||||
|
|
||||||
|
struct _GtkClipLabel
|
||||||
|
{
|
||||||
|
GtkLabel misc;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GtkClipLabelClass
|
||||||
|
{
|
||||||
|
GtkLabelClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
guint gtk_clip_label_get_type (void);
|
||||||
|
GtkWidget* gtk_clip_label_new (const char *str);
|
||||||
|
void gtk_clip_label_set (GtkLabel *label,
|
||||||
|
const char *str);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __GTK_CLIP_LABEL_H__ */
|
@ -96,11 +96,13 @@ get_desktop_icon (char *pathname)
|
|||||||
fname = regex_command (x_basename (pathname), "Icon", 0, 0);
|
fname = regex_command (x_basename (pathname), "Icon", 0, 0);
|
||||||
|
|
||||||
/* Try the GNOME icon */
|
/* Try the GNOME icon */
|
||||||
full_fname = gnome_unconditional_pixmap_file (fname);
|
if (fname){
|
||||||
if (exist_file (full_fname))
|
full_fname = gnome_unconditional_pixmap_file (fname);
|
||||||
return full_fname;
|
if (exist_file (full_fname))
|
||||||
g_free (full_fname);
|
return full_fname;
|
||||||
|
g_free (full_fname);
|
||||||
|
}
|
||||||
|
|
||||||
/* Try a mc icon */
|
/* Try a mc icon */
|
||||||
full_fname = concat_dir_and_file (ICONDIR, fname);
|
full_fname = concat_dir_and_file (ICONDIR, fname);
|
||||||
if (exist_file (full_fname))
|
if (exist_file (full_fname))
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "boxes.h"
|
#include "boxes.h"
|
||||||
#include "panelize.h"
|
#include "panelize.h"
|
||||||
#include "gcmd.h"
|
#include "gcmd.h"
|
||||||
|
#include "gcliplabel.h"
|
||||||
|
|
||||||
#define UNDEFINED_INDEX -1
|
#define UNDEFINED_INDEX -1
|
||||||
|
|
||||||
|
@ -322,19 +322,35 @@ dialog_panel_callback (struct Dlg_head *h, int id, int msg)
|
|||||||
{
|
{
|
||||||
WPanel *p;
|
WPanel *p;
|
||||||
WInput *in;
|
WInput *in;
|
||||||
|
void *current_widget; /* The widget.wdata of the current widget */
|
||||||
|
|
||||||
if (msg == DLG_KEY && id == '\n'){
|
if (msg == DLG_KEY && id == '\n'){
|
||||||
if (h->current->widget->callback == (callback_fn) panel_callback)
|
if (h->current->widget->callback == (callback_fn) panel_callback)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
/* Find out which one of the widgets is the WPanel */
|
||||||
* If this was a keystroke, and the current widget is not the
|
p = (WPanel *) find_widget_type (h, (callback_fn) panel_callback);
|
||||||
* panel, it is the filter
|
g_return_if_fail (p != 0);
|
||||||
*/
|
|
||||||
p = (WPanel *) h->current->next->widget;
|
current_widget = (void *) h->current->widget;
|
||||||
in = (WInput *) h->current->widget;
|
|
||||||
|
printf ("Got an enter\n");
|
||||||
set_panel_filter_to (p, strdup (in->buffer));
|
if (current_widget == p->filter_w){
|
||||||
|
printf ("It is the filter\n");
|
||||||
|
|
||||||
|
in = (WInput *) current_widget;
|
||||||
|
set_panel_filter_to (p, strdup (in->buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current_widget == p->current_dir){
|
||||||
|
WInput *in = p->current_dir;
|
||||||
|
|
||||||
|
do_panel_cd (p, in->buffer, cd_parse_command);
|
||||||
|
assign_text (in, p->cwd);
|
||||||
|
update_input (in);
|
||||||
|
|
||||||
|
return MSG_HANDLED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return default_dlg_callback (h, id, msg);
|
return default_dlg_callback (h, id, msg);
|
||||||
}
|
}
|
||||||
|
104
gnome/gscreen.c
104
gnome/gscreen.c
@ -29,6 +29,7 @@
|
|||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
#include "gdesktop.h"
|
#include "gdesktop.h"
|
||||||
#include "gpageprop.h"
|
#include "gpageprop.h"
|
||||||
|
#include "gcliplabel.h"
|
||||||
|
|
||||||
/* The pixmaps */
|
/* The pixmaps */
|
||||||
#include "directory.xpm"
|
#include "directory.xpm"
|
||||||
@ -70,7 +71,8 @@ repaint_file (WPanel *panel, int file_index, int move, int attr, int isstatus)
|
|||||||
void
|
void
|
||||||
show_dir (WPanel *panel)
|
show_dir (WPanel *panel)
|
||||||
{
|
{
|
||||||
gtk_entry_set_text (GTK_ENTRY (panel->current_dir), panel->cwd);
|
assign_text (panel->current_dir, panel->cwd);
|
||||||
|
update_input (panel->current_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -134,8 +136,8 @@ x_fill_panel (WPanel *panel)
|
|||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
gtk_clist_append (cl, texts);
|
gtk_clist_append (cl, texts);
|
||||||
|
|
||||||
color = file_entry_color (fe);
|
color = file_compute_color (fe->f.marked ? MARKED : NORMAL, fe);
|
||||||
panel_file_list_set_row_colors (cl, i, color);
|
panel_file_list_set_row_colors (cl, i, color);
|
||||||
if (type_col != -1)
|
if (type_col != -1)
|
||||||
panel_file_list_set_type_bitmap (cl, i, type_col, color, fe);
|
panel_file_list_set_type_bitmap (cl, i, type_col, color, fe);
|
||||||
@ -191,7 +193,6 @@ x_select_item (WPanel *panel)
|
|||||||
gtk_clist_select_row (clist, panel->selected, 0);
|
gtk_clist_select_row (clist, panel->selected, 0);
|
||||||
|
|
||||||
if (gtk_clist_row_is_visible (clist, panel->selected) != GTK_VISIBILITY_FULL){
|
if (gtk_clist_row_is_visible (clist, panel->selected) != GTK_VISIBILITY_FULL){
|
||||||
printf ("No fue visible %d\n", panel->selected);
|
|
||||||
gtk_clist_moveto (clist, panel->selected, 0, 0.5, 0.0);
|
gtk_clist_moveto (clist, panel->selected, 0, 0.5, 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,8 +206,8 @@ x_unselect_item (WPanel *panel)
|
|||||||
void
|
void
|
||||||
x_filter_changed (WPanel *panel)
|
x_filter_changed (WPanel *panel)
|
||||||
{
|
{
|
||||||
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (panel->filter_w))),
|
assign_text (panel->filter_w, panel->filter ? panel->filter : "");
|
||||||
panel->filter ? panel->filter : "");
|
update_input (panel->filter_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -226,7 +227,7 @@ panel_file_list_configure_contents (GtkWidget *file_list, WPanel *panel, int mai
|
|||||||
int char_width, usable_pixels, extra_pixels, width;
|
int char_width, usable_pixels, extra_pixels, width;
|
||||||
int total_columns, extra_columns;
|
int total_columns, extra_columns;
|
||||||
int expand_space, extra_space, shrink_space;
|
int expand_space, extra_space, shrink_space;
|
||||||
int lost_pixels;
|
int lost_pixels, display_the_mini_info;
|
||||||
|
|
||||||
/* Pass 1: Count minimum columns,
|
/* Pass 1: Count minimum columns,
|
||||||
* set field_len to default to the requested_field_len
|
* set field_len to default to the requested_field_len
|
||||||
@ -264,7 +265,16 @@ panel_file_list_configure_contents (GtkWidget *file_list, WPanel *panel, int mai
|
|||||||
} else
|
} else
|
||||||
extra_space = expand_space = 0;
|
extra_space = expand_space = 0;
|
||||||
|
|
||||||
|
/* Hack: the default mini-info display only gets displayed
|
||||||
|
* if panel->estimated_total is not zero, ie, if this has been
|
||||||
|
* initialized for the first time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
display_the_mini_info = (panel->estimated_total == 0);
|
||||||
panel->estimated_total = total_columns;
|
panel->estimated_total = total_columns;
|
||||||
|
|
||||||
|
if (display_the_mini_info)
|
||||||
|
display_mini_info (panel);
|
||||||
|
|
||||||
/* If we dont have enough space, shorten the fields */
|
/* If we dont have enough space, shorten the fields */
|
||||||
if (used_columns > total_columns){
|
if (used_columns > total_columns){
|
||||||
@ -672,7 +682,6 @@ panel_build_selected_file_list (WPanel *panel, int *file_list_len)
|
|||||||
if (panel->dir.list [i].f.marked)
|
if (panel->dir.list [i].f.marked)
|
||||||
total_len += (cwdlen + panel->dir.list [i].fnamelen + 1);
|
total_len += (cwdlen + panel->dir.list [i].fnamelen + 1);
|
||||||
|
|
||||||
printf ("Total lenght: %d\n", total_len);
|
|
||||||
data = copy = xmalloc (total_len, "build_selected_file_list");
|
data = copy = xmalloc (total_len, "build_selected_file_list");
|
||||||
for (i = 0; i < panel->count; i++)
|
for (i = 0; i < panel->count; i++)
|
||||||
if (panel->dir.list [i].f.marked){
|
if (panel->dir.list [i].f.marked){
|
||||||
@ -715,8 +724,6 @@ panel_drag_request (GtkWidget *widget, GdkEventDragRequest *event, WPanel *panel
|
|||||||
static void
|
static void
|
||||||
panel_drop_enter (GtkWidget *widget, GdkEvent *event)
|
panel_drop_enter (GtkWidget *widget, GdkEvent *event)
|
||||||
{
|
{
|
||||||
printf ("%s\n", event->type == GDK_DROP_ENTER ? "DROP ENTER" :
|
|
||||||
(event->type == GDK_DROP_LEAVE ? "DROP LEAVE" : "?"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -902,14 +909,8 @@ panel_switch_new_display_mode (WPanel *panel)
|
|||||||
panel_update_contents (panel);
|
panel_update_contents (panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
change_cwd (GtkWidget *entry, WPanel *panel)
|
|
||||||
{
|
|
||||||
printf ("Cambiando a...%s\n", "xxx");
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
panel_create_cwd (Dlg_head *h, WPanel *panel, GtkWidget **the_entry)
|
panel_create_cwd (Dlg_head *h, WPanel *panel, void **entry)
|
||||||
{
|
{
|
||||||
WInput *in;
|
WInput *in;
|
||||||
|
|
||||||
@ -919,11 +920,7 @@ panel_create_cwd (Dlg_head *h, WPanel *panel, GtkWidget **the_entry)
|
|||||||
/* Force the creation of the gtk widget */
|
/* Force the creation of the gtk widget */
|
||||||
send_message_to (h, (Widget *) in, WIDGET_INIT, 0);
|
send_message_to (h, (Widget *) in, WIDGET_INIT, 0);
|
||||||
|
|
||||||
*the_entry = gnome_entry_gtk_entry (GNOME_ENTRY (in->widget.wdata));
|
*entry = in;
|
||||||
gtk_signal_connect (GTK_OBJECT (*the_entry),
|
|
||||||
"activate",
|
|
||||||
GTK_SIGNAL_FUNC (change_cwd), panel);
|
|
||||||
|
|
||||||
return GTK_WIDGET (in->widget.wdata);
|
return GTK_WIDGET (in->widget.wdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -932,7 +929,7 @@ panel_change_filter (GtkWidget *entry, WPanel *panel)
|
|||||||
{
|
{
|
||||||
char *reg_exp;
|
char *reg_exp;
|
||||||
|
|
||||||
reg_exp = gtk_entry_get_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))));
|
reg_exp = ((WInput *)panel->filter_w)->buffer;
|
||||||
set_panel_filter_to (panel, strdup (reg_exp));
|
set_panel_filter_to (panel, strdup (reg_exp));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1098,11 +1095,11 @@ void
|
|||||||
display_mini_info (WPanel *panel)
|
display_mini_info (WPanel *panel)
|
||||||
{
|
{
|
||||||
GtkLabel *label = GTK_LABEL (panel->ministatus);
|
GtkLabel *label = GTK_LABEL (panel->ministatus);
|
||||||
|
|
||||||
if (panel->searching){
|
if (panel->searching){
|
||||||
char *str = copy_strings ("Search: ", panel->search_buffer, NULL);
|
char *str = copy_strings ("Search: ", panel->search_buffer, NULL);
|
||||||
|
|
||||||
gtk_label_set (label, str);
|
gtk_clip_label_set (label, str);
|
||||||
free (str);
|
free (str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1110,11 +1107,12 @@ display_mini_info (WPanel *panel)
|
|||||||
if (panel->marked){
|
if (panel->marked){
|
||||||
char buffer [120];
|
char buffer [120];
|
||||||
|
|
||||||
sprintf (buffer, " %s bytes in %d files%s",
|
sprintf (buffer, " %s bytes in %d file%s",
|
||||||
size_trunc_sep (panel->total), panel->marked,
|
size_trunc_sep (panel->total), panel->marked,
|
||||||
panel->marked == 1 ? "" : "s");
|
panel->marked == 1 ? "" : "s");
|
||||||
|
|
||||||
gtk_label_set (label, buffer);
|
gtk_clip_label_set (label, buffer);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISLNK (panel->dir.list [panel->selected].buf.st_mode)){
|
if (S_ISLNK (panel->dir.list [panel->selected].buf.st_mode)){
|
||||||
@ -1130,10 +1128,10 @@ display_mini_info (WPanel *panel)
|
|||||||
|
|
||||||
link_target [len] = 0;
|
link_target [len] = 0;
|
||||||
str = copy_strings ("-> ", link_target, NULL);
|
str = copy_strings ("-> ", link_target, NULL);
|
||||||
gtk_label_set (label, str);
|
gtk_clip_label_set (label, str);
|
||||||
free (str);
|
free (str);
|
||||||
} else
|
} else
|
||||||
gtk_label_set (label, "<readlink failed>");
|
gtk_clip_label_set (label, "<readlink failed>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1144,14 +1142,13 @@ display_mini_info (WPanel *panel)
|
|||||||
buffer = xmalloc (len + 2, "display_mini_info");
|
buffer = xmalloc (len + 2, "display_mini_info");
|
||||||
format_file (buffer, panel, panel->selected, panel->estimated_total-2, 0, 1);
|
format_file (buffer, panel, panel->selected, panel->estimated_total-2, 0, 1);
|
||||||
buffer [len] = 0;
|
buffer [len] = 0;
|
||||||
gtk_label_set (label, buffer);
|
gtk_clip_label_set (label, buffer);
|
||||||
|
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
panel_create_filter (Dlg_head *h, WPanel *panel, GtkWidget **filter_w)
|
panel_create_filter (Dlg_head *h, WPanel *panel, void **filter_w)
|
||||||
{
|
{
|
||||||
GtkWidget *fhbox;
|
GtkWidget *fhbox;
|
||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
@ -1191,18 +1188,9 @@ panel_create_filter (Dlg_head *h, WPanel *panel, GtkWidget **filter_w)
|
|||||||
|
|
||||||
/* Force the creation of the gtk widget */
|
/* Force the creation of the gtk widget */
|
||||||
send_message_to (h, (Widget *) in, WIDGET_INIT, 0);
|
send_message_to (h, (Widget *) in, WIDGET_INIT, 0);
|
||||||
*filter_w = (GtkWidget *) in->widget.wdata;
|
*filter_w = in;
|
||||||
|
|
||||||
/* We do not want the focus by default (and the previos add_widget just gave it to us) */
|
gtk_box_pack_start (GTK_BOX (fhbox), GTK_WIDGET (in->widget.wdata), TRUE, TRUE, 0);
|
||||||
h->current = h->current->prev;
|
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (gnome_entry_gtk_entry (GNOME_ENTRY (*filter_w))),
|
|
||||||
"activate",
|
|
||||||
GTK_SIGNAL_FUNC (panel_change_filter),
|
|
||||||
panel);
|
|
||||||
|
|
||||||
gtk_box_pack_start (GTK_BOX (fhbox), *filter_w, TRUE, TRUE, 0);
|
|
||||||
gtk_widget_show (*filter_w);
|
|
||||||
|
|
||||||
return fhbox;
|
return fhbox;
|
||||||
}
|
}
|
||||||
@ -1211,33 +1199,38 @@ void
|
|||||||
x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
||||||
{
|
{
|
||||||
GtkWidget *status_line, *filter, *vbox;
|
GtkWidget *status_line, *filter, *vbox;
|
||||||
GtkWidget *ministatus_align, *frame, *cwd;
|
GtkWidget *frame, *cwd;
|
||||||
|
|
||||||
panel->table = gtk_table_new (2, 1, 0);
|
panel->table = gtk_table_new (2, 1, 0);
|
||||||
|
|
||||||
panel->list = panel_create_file_list (panel);
|
panel->list = panel_create_file_list (panel);
|
||||||
|
|
||||||
|
filter = panel_create_filter (h, panel, &panel->filter_w);
|
||||||
cwd = panel_create_cwd (h, panel, &panel->current_dir);
|
cwd = panel_create_cwd (h, panel, &panel->current_dir);
|
||||||
|
|
||||||
filter = panel_create_filter (h, panel, (GtkWidget **) &panel->filter_w);
|
/* We do not want the focus by default (and the previos add_widget just gave it to us) */
|
||||||
|
h->current = h->current->prev;
|
||||||
|
|
||||||
/* ministatus */
|
/* ministatus */
|
||||||
ministatus_align = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
|
panel->ministatus = gtk_clip_label_new ("");
|
||||||
panel->ministatus = gtk_label_new ("");
|
gtk_misc_set_alignment (GTK_MISC (panel->ministatus), 0.0, 0.0);
|
||||||
gtk_container_add (GTK_CONTAINER (ministatus_align), panel->ministatus);
|
gtk_misc_set_padding (GTK_MISC (panel->ministatus), 3, 0);
|
||||||
|
|
||||||
status_line = gtk_hbox_new (0, 0);
|
status_line = gtk_hbox_new (0, 0);
|
||||||
|
gtk_label_set_justify (GTK_LABEL (panel->ministatus), GTK_JUSTIFY_LEFT);
|
||||||
gtk_box_pack_start (GTK_BOX (status_line), cwd, 1, 1, 0);
|
gtk_box_pack_start (GTK_BOX (status_line), cwd, 1, 1, 0);
|
||||||
gtk_box_pack_end (GTK_BOX (status_line), filter, 0, 0, 0);
|
gtk_box_pack_end (GTK_BOX (status_line), filter, 0, 0, 0);
|
||||||
|
|
||||||
/* The statusbar */
|
/* The statusbar */
|
||||||
frame = gtk_frame_new (NULL);
|
frame = gtk_frame_new (NULL);
|
||||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||||
gtk_container_border_width (GTK_CONTAINER (frame), 3);
|
gtk_container_border_width (GTK_CONTAINER (frame), 3);
|
||||||
panel->status = gtk_label_new ("");
|
|
||||||
|
panel->status = gtk_clip_label_new ("");
|
||||||
|
gtk_misc_set_alignment (GTK_MISC (panel->status), 0.0, 0.5);
|
||||||
|
gtk_misc_set_padding (GTK_MISC (panel->status), 3, 0);
|
||||||
gtk_container_add (GTK_CONTAINER (frame), panel->status);
|
gtk_container_add (GTK_CONTAINER (frame), panel->status);
|
||||||
|
gtk_label_set_justify (GTK_LABEL (panel->status), GTK_JUSTIFY_LEFT);
|
||||||
|
|
||||||
gtk_table_attach (GTK_TABLE (panel->table), panel->list, 0, 1, 1, 2,
|
gtk_table_attach (GTK_TABLE (panel->table), panel->list, 0, 1, 1, 2,
|
||||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||||
@ -1246,10 +1239,9 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
|
|||||||
gtk_table_attach (GTK_TABLE (panel->table), status_line, 0, 1, 0, 1,
|
gtk_table_attach (GTK_TABLE (panel->table), status_line, 0, 1, 0, 1,
|
||||||
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
|
GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
|
||||||
|
|
||||||
gtk_table_attach (GTK_TABLE (panel->table), ministatus_align, 0, 1, 2, 3,
|
gtk_table_attach (GTK_TABLE (panel->table), panel->ministatus, 0, 1, 2, 3,
|
||||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
|
||||||
gtk_table_attach (GTK_TABLE (panel->table), frame, 0, 1, 3, 4,
|
gtk_table_attach (GTK_TABLE (panel->table), frame, 0, 1, 3, 4,
|
||||||
GTK_EXPAND | GTK_FILL,
|
GTK_EXPAND | GTK_FILL,
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
|
@ -259,7 +259,6 @@ x_update_input (WInput *in)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
gtk_entry_set_text (entry, in->buffer);
|
gtk_entry_set_text (entry, in->buffer);
|
||||||
printf ("POniendo el putno en %d\n", in->point);
|
|
||||||
gtk_entry_set_position (entry, in->point);
|
gtk_entry_set_position (entry, in->point);
|
||||||
gtk_widget_draw (GTK_WIDGET (gnome_entry), NULL);
|
gtk_widget_draw (GTK_WIDGET (gnome_entry), NULL);
|
||||||
}
|
}
|
||||||
|
@ -112,11 +112,11 @@ typedef struct {
|
|||||||
/* These are standard GtkWidgets */
|
/* These are standard GtkWidgets */
|
||||||
void *table;
|
void *table;
|
||||||
void *list;
|
void *list;
|
||||||
void *current_dir;
|
|
||||||
void *filter_w;
|
|
||||||
void *status;
|
void *status;
|
||||||
void *ministatus;
|
void *ministatus;
|
||||||
|
|
||||||
|
void *filter_w; /* A WInput* */
|
||||||
|
void *current_dir; /* A WInput* */
|
||||||
int estimated_total;
|
int estimated_total;
|
||||||
#endif
|
#endif
|
||||||
} WPanel;
|
} WPanel;
|
||||||
|
Loading…
Reference in New Issue
Block a user