Die Akzentfarbe von den Chatgruppen vom Server wird berücksichtigt. Bilder sind im richtigen Seitenverhältnis skaliert. Ein Bild, das man gerade erst verschickt hat und das man öffnen will, bevor es auf dem Server angekommen ist, wird jetzt erst angezeigt, sobald es auf dem Server ist. Die Textbox für eine neue Nachricht wird nur angezeigt, wenn eine Gruppe ausgewählt ist und wenn man das Recht hat Nachrichten an diese Gruppe zu verschicken. Diverse Codeverbesserungen.
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System;
|
|
using System.Windows;
|
|
|
|
using ChatController.LoginKlassen;
|
|
|
|
using Point = System.Windows.Point;
|
|
|
|
|
|
namespace ownChat
|
|
{
|
|
public partial class MainWindow
|
|
{
|
|
private readonly ChatEmojisView _EmojiView;
|
|
|
|
public MainWindow(ChatDatenUebergabe x)
|
|
{
|
|
InitializeComponent();
|
|
|
|
ChatMainControl.ContainingWindow = this;
|
|
|
|
ChatMainControl.InitMitChatdaten(x);
|
|
ChatMainControl.ResetStyle();
|
|
|
|
_EmojiView = new ChatEmojisView(ChatMainControl);
|
|
}
|
|
|
|
private void ChatMainControl_OnOnEmojii(System.Windows.Controls.Button emojiButton)
|
|
{
|
|
_EmojiView.Visibility = Visibility.Visible;
|
|
|
|
var pointToScreen = emojiButton.PointToScreen(new Point(0, 0));
|
|
var presentationSource = PresentationSource.FromVisual(emojiButton);
|
|
|
|
if(presentationSource?.CompositionTarget != null)
|
|
{
|
|
_EmojiView.Top = pointToScreen.Y / presentationSource.CompositionTarget.TransformToDevice.M22 - _EmojiView.Height - 5;
|
|
_EmojiView.Left = pointToScreen.X / presentationSource.CompositionTarget.TransformToDevice.M11 - 270;
|
|
}
|
|
}
|
|
|
|
private void MainWindow_OnClosed(object sender, EventArgs e)
|
|
{
|
|
ChatMainControl.DeleteTempFiles();
|
|
ChatMainControl.WriteToNewSyncFile();
|
|
ChatMainControl.ClearNotifications();
|
|
Environment.Exit(0);
|
|
}
|
|
}
|
|
}
|