static DatetimePlugin *
datetime_new (void)
{
    DatetimePlugin *datetime;

    datetime = g_new (DatetimePlugin, 1);
    datetime->orientation = GTK_ORIENTATION_HORIZONTAL;
    datetime->layout = LAYOUT_VERTICAL;
    datetime->date_font = NULL;
    datetime->date_format = NULL;
    datetime->time_font = NULL;
    datetime->time_format = NULL;
    datetime->use_xfcalendar = FALSE;
    datetime->week_start_monday = FALSE;

    create_main_widget(datetime);

    /* calendar */
    datetime->cal = NULL;

    datetime_apply_font(datetime,
			"Bitstream Vera Sans 9",
			"Bitstream Vera Sans 12");
    /* This is default date/time format, (See strftime(3))
       translaters may change this to familiar format for their language */
    datetime_apply_format(datetime, _("%Y-%m-%d"), _("%H:%M"));

    datetime_update(datetime);

    gtk_widget_show_all(datetime->eventbox);

    return datetime;
}
static void
datetime_set_size(Control *control, int size)
{
    int threshold;
    int new_layout;
    DatetimePlugin *datetime;

    g_return_if_fail (control != NULL && control->data != NULL);

    datetime = control->data;

    if (size < MEDIUM)
	new_layout = LAYOUT_HORIZONTAL;
    else
	new_layout = LAYOUT_VERTICAL;

    if (new_layout != datetime->layout) {
	gtk_widget_destroy(GTK_WIDGET(datetime->eventbox));
	datetime->layout = new_layout;
	create_main_widget(datetime);
	datetime_update_date_font(datetime);
	datetime_update_time_font(datetime);
	datetime_update(datetime);
	gtk_widget_show_all(datetime->eventbox);
	gtk_container_add (GTK_CONTAINER (control->base), datetime->eventbox);
    }

    threshold = icon_size[size];
    if (datetime->orientation == GTK_ORIENTATION_VERTICAL)
	gtk_widget_set_size_request (control->base, threshold, -1);
    else
	gtk_widget_set_size_request (control->base, -1, threshold);
}
Esempio n. 3
0
FileManager::FileManager(QWidget * parent , const char * name , WFlags f ):QMainWindow(parent,name,f)
{
  layout_ = new QVBoxLayout( this );
  layout_->setSpacing(2);
  layout_->setMargin(2);

  create_menu();
  create_select_dir();
  create_main_widget();

  le_on_dirtree_ = new RenameLineEdit(dirtree_view_);
  le_on_dirtree_ -> hide();

  le_on_dir_content_ = new RenameLineEdit(dir_content_);
  le_on_dir_content_ -> hide();

  connect(le_on_dirtree_, SIGNAL( lost_focus() ), SLOT( rename() ) );
  connect(le_on_dirtree_, SIGNAL(returnPressed()), this, SLOT(rename()));

  connect(le_on_dir_content_, SIGNAL( lost_focus() ), SLOT( rename() ) );
  connect(le_on_dir_content_, SIGNAL(returnPressed()), this, SLOT(rename()));



  //QHBox *line_box = new QHBox( this );
  //layout->addWidget(line_box);

  //layout->addWidget(v_box_2);
  //layout->addWidget(widget_stack);


  connect(dir_content_, SIGNAL( opendir ( const std::string &) ), this, SLOT(change_dirtreeview_item(const std::string & )) );

  status_bar_ = statusBar ();


  if (status_bar_!=0)
  {
    qDebug("have status bar");
    //grid_layout->addMultiCellWidget(status_bar_,3,3,0,1);
    layout_->addWidget(status_bar_);
  }
  else
    qDebug("don't have status bar");
//#endif
}