~ubuntu-branches/ubuntu/vivid/latexila/vivid

« back to all changes in this revision

Viewing changes to src/templates.vala

  • Committer: Bazaar Package Importer
  • Author(s): Tanguy Ortolo
  • Date: 2011-03-08 20:12:19 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110308201219-umwprmma6w4o205l
Tags: 2.0.6-1
* New upstream release (bug fixes). (Closes: #615844)
* debian/control: depend on rubber (a LaTeX IDE is almost useless if it
  cannot compile). (Closes: #617348)

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
            STOCK_CANCEL, ResponseType.REJECT,
118
118
            null);
119
119
 
120
 
        dialog.set_default_size (400, 340);
121
 
 
122
 
        Box content_area1 = (Box) dialog.get_content_area ();
123
 
        VBox content_area = new VBox (false, 18);
124
 
        content_area.set_border_width (10);
125
 
        content_area1.pack_start (content_area);
 
120
        // get and set previous size
 
121
        GLib.Settings settings = new GLib.Settings ("org.gnome.latexila.state.window");
 
122
        int w, h;
 
123
        settings.get ("new-file-dialog-size", "(ii)", out w, out h);
 
124
        dialog.set_default_size (w, h);
 
125
 
 
126
        // without this, we can not shrink the dialog completely
 
127
        dialog.set_size_request (0, 0);
 
128
 
 
129
        Box content_area = (Box) dialog.get_content_area ();
 
130
        VPaned vpaned = new VPaned ();
 
131
        content_area.pack_start (vpaned);
 
132
        vpaned.position = settings.get_int ("new-file-dialog-paned-position");
126
133
 
127
134
        /* icon view for the default templates */
128
135
        IconView icon_view_default_templates = create_icon_view (default_store);
129
136
        Widget component = get_dialog_component (_("Default templates"),
130
137
            icon_view_default_templates);
131
 
        content_area.pack_start (component);
 
138
        vpaned.pack1 (component, true, true);
132
139
 
133
140
            /* icon view for the personnal templates */
134
141
            IconView icon_view_personnal_templates = create_icon_view (personnal_store);
135
142
            component = get_dialog_component (_("Your personnal templates"),
136
143
                icon_view_personnal_templates);
137
 
            content_area.pack_start (component);
 
144
            vpaned.pack2 (component, false, true);
138
145
 
139
 
            content_area1.show_all ();
 
146
            content_area.show_all ();
140
147
 
141
148
            icon_view_default_templates.selection_changed.connect (() =>
142
149
            {
175
182
            tab.document.set_contents (contents);
176
183
            }
177
184
 
 
185
            // save dialog size and paned position
 
186
            dialog.get_size (out w, out h);
 
187
            settings.set ("new-file-dialog-size", "(ii)", w, h);
 
188
            settings.set_int ("new-file-dialog-paned-position", vpaned.position);
 
189
 
178
190
            dialog.destroy ();
179
191
    }
180
192