Browse Source

Innerframe titles are now displayed in the main titlebar when maximised

git-svn-id: http://svn.dmdirc.com/trunk@215 00569f92-eb28-0410-84fd-f71c24880f
tags/0.1
Chris Smith 17 years ago
parent
commit
f458a89309

+ 7
- 1
src/uk/org/ownage/dmdirc/Channel.java View File

@@ -123,7 +123,13 @@ public class Channel implements IChannelMessage, IChannelGotNames, IChannelTopic
123 123
     }
124 124
     
125 125
     private void updateTitle() {
126
-        frame.setTitle(channelInfo.getName()+" - "+channelInfo.getTopic());
126
+        String title = channelInfo.getName()+" - "+channelInfo.getTopic();
127
+        
128
+        frame.setTitle(title);
129
+        
130
+        if (frame.isMaximum() && MainFrame.getMainFrame().getActiveFrame().equals(frame)) {
131
+            MainFrame.getMainFrame().setTitle("DMDirc - "+title);
132
+        }
127 133
     }
128 134
     
129 135
     public void onChannelJoin(IRCParser tParser, ChannelInfo cChannel, ChannelClientInfo cChannelClient) {

+ 5
- 5
src/uk/org/ownage/dmdirc/Raw.java View File

@@ -60,13 +60,13 @@ public class Raw implements IDataIn, IDataOut {
60 60
         MainFrame.getMainFrame().addChild(frame);
61 61
         
62 62
         try {
63
-        server.getParser().getCallbackManager().addCallback("OnDataIn", this);
64
-        server.getParser().getCallbackManager().addCallback("OnDataOut", this);
63
+            server.getParser().getCallbackManager().addCallback("OnDataIn", this);
64
+            server.getParser().getCallbackManager().addCallback("OnDataOut", this);
65 65
         } catch (CallbackNotFound ex) {
66 66
             Logger.error(ErrorLevel.FATAL, ex);
67 67
         }
68 68
     }
69
-
69
+    
70 70
     void close() {
71 71
         server.getParser().getCallbackManager().delCallback("OnDataIn", this);
72 72
         server.getParser().getCallbackManager().delCallback("OnDataOut", this);
@@ -76,11 +76,11 @@ public class Raw implements IDataIn, IDataOut {
76 76
         frame = null;
77 77
         server = null;
78 78
     }
79
-
79
+    
80 80
     public void onDataIn(IRCParser tParser, String sData) {
81 81
         frame.addLine("<<< "+sData);
82 82
     }
83
-
83
+    
84 84
     public void onDataOut(IRCParser tParser, String sData, boolean bFromParser) {
85 85
         frame.addLine(">>> "+sData);
86 86
     }

+ 8
- 1
src/uk/org/ownage/dmdirc/ui/MainFrame.java View File

@@ -141,6 +141,13 @@ public class MainFrame extends javax.swing.JFrame implements WindowListener {
141 141
      */
142 142
     public void setMaximised(boolean max) {
143 143
         maximised = max;
144
+        
145
+        if (max && getActiveFrame() != null) {
146
+            setTitle("DMDirc - "+getActiveFrame().getTitle());
147
+        } else if (!max) {
148
+            setTitle("DMDirc");
149
+        }
150
+        
144 151
         checkWindowState();
145 152
     }
146 153
     
@@ -152,7 +159,7 @@ public class MainFrame extends javax.swing.JFrame implements WindowListener {
152 159
         
153 160
         toggleStateMenuItem.setEnabled(true);
154 161
         
155
-        if (getActiveFrame().isMaximum()) {
162
+        if (maximised) {
156 163
             toggleStateMenuItem.setText("Restore");
157 164
             toggleStateMenuItem.setMnemonic('r');
158 165
             toggleStateMenuItem.invalidate();

Loading…
Cancel
Save