Changeset 3144


Ignore:
Timestamp:
Oct 30, 2008, 2:02:29 AM (12 years ago)
Author:
Sam Hocevar
Message:

ThePimp?: add Fullscreen support, including the F11 binding.

Location:
libpipi/trunk/ThePimp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/ThePimp/gtk-gui/ThePimp.MainWindow.cs

    r2950 r3144  
    6969       
    7070        private Gtk.Action saveAsAction;
     71       
     72        private Gtk.Action FullscreenAction;
    7173       
    7274        private Gtk.VBox vbox1;
     
    182184            this.saveAsAction = new Gtk.Action("saveAsAction", null, Mono.Unix.Catalog.GetString("Save active image "), "gtk-save-as");
    183185            w2.Add(this.saveAsAction, null);
     186            this.FullscreenAction = new Gtk.Action("FullscreenAction", Mono.Unix.Catalog.GetString("Fullscreen"), null, "gtk-fullscreen");
     187            this.FullscreenAction.ShortLabel = Mono.Unix.Catalog.GetString("Fullscreen");
     188            w2.Add(this.FullscreenAction, null);
    184189            w1.InsertActionGroup(w2, 0);
    185190            this.AddAccelGroup(w1.AccelGroup);
     
    192197            this.vbox1.Name = "vbox1";
    193198            // Container child vbox1.Gtk.Box+BoxChild
    194             w1.AddUiFromString("<ui><menubar name='menubar1'><menu action='FileAction'><menuitem action='NewAction'/><menuitem action='OpenAction'/><menuitem action='SaveAction'/><menuitem action='SaveAsAction'/><menuitem action='QuitAction'/></menu><menu action='EditAction'><menuitem action='UndoAction'/><menuitem action='RedoAction'/></menu><menu action='ViewAction'><menuitem action='ZoomInAction'/><menuitem action='ZoomOutAction'/><menuitem action='BestFitAction'/><menuitem action='NormalSizeAction'/></menu><menu action='HelpAction'><menuitem action='HelpAction1'/><menuitem action='AboutAction'/></menu></menubar></ui>");
     199            w1.AddUiFromString("<ui><menubar name='menubar1'><menu action='FileAction'><menuitem action='NewAction'/><menuitem action='OpenAction'/><menuitem action='SaveAction'/><menuitem action='SaveAsAction'/><menuitem action='QuitAction'/></menu><menu action='EditAction'><menuitem action='UndoAction'/><menuitem action='RedoAction'/></menu><menu action='ViewAction'><menuitem action='ZoomInAction'/><menuitem action='ZoomOutAction'/><menuitem action='BestFitAction'/><menuitem action='NormalSizeAction'/><separator/><menuitem action='FullscreenAction'/></menu><menu action='HelpAction'><menuitem action='HelpAction1'/><menuitem action='AboutAction'/></menu></menubar></ui>");
    195200            this.menubar1 = ((Gtk.MenuBar)(w1.GetWidget("/menubar1")));
    196201            this.menubar1.Name = "menubar1";
     
    220225            this.vpaned1.CanFocus = true;
    221226            this.vpaned1.Name = "vpaned1";
    222             this.vpaned1.Position = 42;
     227            this.vpaned1.Position = 41;
    223228            this.hpaned1.Add(this.vpaned1);
    224229            Gtk.Paned.PanedChild w5 = ((Gtk.Paned.PanedChild)(this.hpaned1[this.vpaned1]));
     
    228233            this.hpaned2.CanFocus = true;
    229234            this.hpaned2.Name = "hpaned2";
    230             this.hpaned2.Position = 883;
     235            this.hpaned2.Position = 886;
    231236            // Container child hpaned2.Gtk.Paned+PanedChild
    232237            this.notebook1 = new Gtk.Notebook();
     
    242247            this.vpaned2.CanFocus = true;
    243248            this.vpaned2.Name = "vpaned2";
    244             this.vpaned2.Position = 42;
     249            this.vpaned2.Position = 41;
    245250            this.hpaned2.Add(this.vpaned2);
    246251            Gtk.Paned.PanedChild w7 = ((Gtk.Paned.PanedChild)(this.hpaned2[this.vpaned2]));
     
    278283            this.AboutAction.Activated += new System.EventHandler(this.OnAboutActionActivated);
    279284            this.saveAsAction.Activated += new System.EventHandler(this.OnSaveAsActionActivated);
     285            this.FullscreenAction.Activated += new System.EventHandler(this.OnFullscreenActionActivated);
    280286        }
    281287    }
  • libpipi/trunk/ThePimp/gtk-gui/gui.stetic

    r3099 r3144  
    194194        <property name="Tooltip" translatable="yes">Save active image </property>
    195195        <signal name="Activated" handler="OnSaveAsActionActivated" />
     196      </action>
     197      <action id="FullscreenAction">
     198        <property name="Type">Action</property>
     199        <property name="Label" translatable="yes">Fullscreen</property>
     200        <property name="ShortLabel" translatable="yes">Fullscreen</property>
     201        <property name="StockId">gtk-fullscreen</property>
     202        <signal name="Activated" handler="OnFullscreenActionActivated" />
    196203      </action>
    197204    </action-group>
     
    224231                <node type="Menuitem" action="BestFitAction" />
    225232                <node type="Menuitem" action="NormalSizeAction" />
     233                <node type="Separator" />
     234                <node type="Menuitem" action="FullscreenAction" />
    226235              </node>
    227236              <node type="Menu" action="HelpAction">
     
    275284                <property name="MemberName" />
    276285                <property name="CanFocus">True</property>
    277                 <property name="Position">42</property>
     286                <property name="Position">41</property>
    278287                <child>
    279288                  <placeholder />
     
    291300                <property name="MemberName" />
    292301                <property name="CanFocus">True</property>
    293                 <property name="Position">883</property>
     302                <property name="Position">886</property>
    294303                <child>
    295304                  <widget class="Gtk.Notebook" id="notebook1">
     
    310319                    <property name="MemberName" />
    311320                    <property name="CanFocus">True</property>
    312                     <property name="Position">42</property>
     321                    <property name="Position">41</property>
    313322                    <child>
    314323                      <placeholder />
  • libpipi/trunk/ThePimp/src/MainWindow.cs

    r3039 r3144  
    2020namespace ThePimp
    2121{
     22    [Gtk.Binding(Gdk.Key.F11, "ToggleFullScreen")]
     23
    2224    public partial class MainWindow: Gtk.Window
    2325    {
     
    103105        {
    104106        }
     107
     108        private bool _fullscreen = false;
     109        protected virtual void ToggleFullScreen()
     110        {
     111            _fullscreen = !_fullscreen;
     112
     113            if(_fullscreen)
     114                Fullscreen();
     115            else
     116                Unfullscreen();
     117        }
     118
     119        protected virtual void OnFullscreenActionActivated (object sender, System.EventArgs e)
     120        {
     121            ToggleFullScreen();
     122        }
    105123    }
    106124}
Note: See TracChangeset for help on using the changeset viewer.