diff --git a/source/Channel.d b/source/Channel.d index 684e11a..33ffb5f 100644 --- a/source/Channel.d +++ b/source/Channel.d @@ -95,11 +95,24 @@ public final class Channel ScrolledWindow scrollTextChats = new ScrolledWindow(textArea); textBox.add(scrollTextChats); + + /* The Box for the whole |attach button| text field| send button| */ + Box textInputBox = new Box(GtkOrientation.HORIZONTAL, 1); + + import gtk.Image; + + /* The attachment button */ + Button attachFileButton = new Button("Upload"); + Image attachFileButtonIcon = new Image("user-available", GtkIconSize.BUTTON); /* TODO: Fix icon now showing */ + attachFileButton.setImage(attachFileButtonIcon); + attachFileButton.addOnClicked(&uploadFileDialog); + textInputBox.add(attachFileButton); + /* The text input */ textInput = new Entry(); textInput.addOnActivate(&sendMessageEnter); textInput.addOnChanged(&textChangd); - Box textInputBox = new Box(GtkOrientation.HORIZONTAL, 1); + textInputBox.packStart(textInput,1,1,0); @@ -117,6 +130,13 @@ public final class Channel } + private void uploadFileDialog(Button e) + { + import gtk.FileChooserDialog; /* TODO: Set parent */ + FileChooserDialog fileChooser = new FileChooserDialog("Send file to "~channelName, null, FileChooserAction.OPEN); + fileChooser.run(); + } + import gtk.EditableIF; private void textChangd(EditableIF) {